(FilenameFilter filter,
File dir,
List<File> results,
boolean recurse)
| 159 | |
| 160 | |
| 161 | private static void testdataFiles(FilenameFilter filter, |
| 162 | File dir, |
| 163 | List<File> results, |
| 164 | boolean recurse) |
| 165 | { |
| 166 | String[] fileNames = dir.list(); |
| 167 | if (fileNames == null) |
| 168 | { |
| 169 | String message = "Not a directory: " + dir.getAbsolutePath(); |
| 170 | throw new IllegalArgumentException(message); |
| 171 | } |
| 172 | |
| 173 | // Sort the fileNames so they are listed in order. |
| 174 | // This is not a functional requirement but it helps humans scanning |
| 175 | // the output looking for a specific file. |
| 176 | Arrays.sort(fileNames); |
| 177 | |
| 178 | for (String fileName : fileNames) |
| 179 | { |
| 180 | File testFile = new File(dir, fileName); |
| 181 | if (testFile.isDirectory()) |
| 182 | { |
| 183 | if (recurse) |
| 184 | { |
| 185 | testdataFiles(filter, testFile, results, recurse); |
| 186 | } |
| 187 | } |
| 188 | else if (filter == null || filter.accept(dir, fileName)) |
| 189 | { |
| 190 | results.add(testFile); |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | public static File[] testdataFiles(FilenameFilter filter, |
| 196 | boolean recurse, |
no test coverage detected