@Test public void searchFilesRecursivelyByName_A$String$String_StringIsEmpty() throws Exception { FileSearcherCommonsIOImpl target = new FileSearcherCommonsIOImpl(); String baseAbsoluteDir = ""; String regexp = ""; try { target.searchFilesRecursivelyByName(baseAbsoluteDir, regexp); fail(); } catch (JUnitHelperCoreException e) { } }
@Override public List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp) { Assertion.on("baseAbsoluteDir").mustNotBeEmpty(baseAbsoluteDir); File dir = new File(baseAbsoluteDir); IOFileFilter fileFilter = new RegexFileFilter(RegExp.Anything_ZeroOrMore_Min + regexp + RegExp.Anything_ZeroOrMore_Min); IOFileFilter dirFilter = new RegexFileFilter("[^(/\\.)]*"); Collection<File> files = FileUtils.listFiles(dir, fileFilter, dirFilter); List<File> dest = new ArrayList<File>(); for (File file : files) { dest.add(file); } return dest; }
FileSearcherCommonsIOImpl implements FileSearcher { @Override public List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp) { Assertion.on("baseAbsoluteDir").mustNotBeEmpty(baseAbsoluteDir); File dir = new File(baseAbsoluteDir); IOFileFilter fileFilter = new RegexFileFilter(RegExp.Anything_ZeroOrMore_Min + regexp + RegExp.Anything_ZeroOrMore_Min); IOFileFilter dirFilter = new RegexFileFilter("[^(/\\.)]*"); Collection<File> files = FileUtils.listFiles(dir, fileFilter, dirFilter); List<File> dest = new ArrayList<File>(); for (File file : files) { dest.add(file); } return dest; } }
FileSearcherCommonsIOImpl implements FileSearcher { @Override public List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp) { Assertion.on("baseAbsoluteDir").mustNotBeEmpty(baseAbsoluteDir); File dir = new File(baseAbsoluteDir); IOFileFilter fileFilter = new RegexFileFilter(RegExp.Anything_ZeroOrMore_Min + regexp + RegExp.Anything_ZeroOrMore_Min); IOFileFilter dirFilter = new RegexFileFilter("[^(/\\.)]*"); Collection<File> files = FileUtils.listFiles(dir, fileFilter, dirFilter); List<File> dest = new ArrayList<File>(); for (File file : files) { dest.add(file); } return dest; }  }
FileSearcherCommonsIOImpl implements FileSearcher { @Override public List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp) { Assertion.on("baseAbsoluteDir").mustNotBeEmpty(baseAbsoluteDir); File dir = new File(baseAbsoluteDir); IOFileFilter fileFilter = new RegexFileFilter(RegExp.Anything_ZeroOrMore_Min + regexp + RegExp.Anything_ZeroOrMore_Min); IOFileFilter dirFilter = new RegexFileFilter("[^(/\\.)]*"); Collection<File> files = FileUtils.listFiles(dir, fileFilter, dirFilter); List<File> dest = new ArrayList<File>(); for (File file : files) { dest.add(file); } return dest; }  @Override List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp); }
FileSearcherCommonsIOImpl implements FileSearcher { @Override public List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp) { Assertion.on("baseAbsoluteDir").mustNotBeEmpty(baseAbsoluteDir); File dir = new File(baseAbsoluteDir); IOFileFilter fileFilter = new RegexFileFilter(RegExp.Anything_ZeroOrMore_Min + regexp + RegExp.Anything_ZeroOrMore_Min); IOFileFilter dirFilter = new RegexFileFilter("[^(/\\.)]*"); Collection<File> files = FileUtils.listFiles(dir, fileFilter, dirFilter); List<File> dest = new ArrayList<File>(); for (File file : files) { dest.add(file); } return dest; }  @Override List<File> searchFilesRecursivelyByName(String baseAbsoluteDir, String regexp);  }