| 168 | |
| 169 | |
| 170 | @Override |
| 171 | public String[] keys() throws IOException { |
| 172 | // Acquire the list of files in our storage directory |
| 173 | File dir = directory(); |
| 174 | if (dir == null) { |
| 175 | return new String[0]; |
| 176 | } |
| 177 | String[] files = dir.list(); |
| 178 | |
| 179 | // Bugzilla 32130 |
| 180 | if (files == null || files.length < 1) { |
| 181 | return new String[0]; |
| 182 | } |
| 183 | |
| 184 | // Build and return the list of session identifiers |
| 185 | List<String> list = new ArrayList<>(); |
| 186 | int n = FILE_EXT.length(); |
| 187 | for (String file : files) { |
| 188 | if (file.endsWith(FILE_EXT)) { |
| 189 | list.add(file.substring(0, file.length() - n)); |
| 190 | } |
| 191 | } |
| 192 | return list.toArray(new String[0]); |
| 193 | } |
| 194 | |
| 195 | |
| 196 | @Override |