ImportFileScanner { public List<File> findDigitalContent(File folder) throws IllegalArgumentException, FileNotFoundException { validateImportFolder(folder); File[] files = folder.listFiles(); List<File> contents = new ArrayList<File>(files.length); for (File file : files) { if (file.isFile()&& file.canRead() && !EXCLUDE_FILENAMES.contains(file.getName())) { contents.add(file); } } Collections.sort(contents, FILE_COMPARATOR); return contents; }  List<Folder> findSubfolders(File folder, ImportHandler importer); List<File> findDigitalContent(File folder); static List<FileSet> getFileSets(List<File> files); static final String IMPORT_STATE_FILENAME; }
@Test public void testFindDigitalContent() throws Exception { File f1 = tmpFolder.newFile("f1.ext"); File f2 = tmpFolder.newFile("f2.ext"); tmpFolder.newFile(ImportFileScanner.IMPORT_STATE_FILENAME); tmpFolder.newFolder(ImportProcess.TMP_DIR_NAME); ImportFileScanner instance = new ImportFileScanner(); List<File> result = instance.findDigitalContent(tmpFolder.getRoot()); assertNotNull(result); assertArrayEquals(new Object[] {f1, f2}, result.toArray()); }