Exemplo n.º 1
0
  public static Collection<File> listFiles(
      File directory, IOFileFilter fileFilter, IOFileFilter dirFilter) {
    validateListFilesParameters(directory, fileFilter);

    IOFileFilter effFileFilter = setUpEffectiveFileFilter(fileFilter);
    IOFileFilter effDirFilter = setUpEffectiveDirFilter(dirFilter);

    Collection<File> files = new LinkedList();
    innerListFiles(
        files,
        directory,
        FileFilterUtils.or(new IOFileFilter[] {effFileFilter, effDirFilter}),
        false);

    return files;
  }
Exemplo n.º 2
0
 private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
   return dirFilter == null
       ? FalseFileFilter.INSTANCE
       : FileFilterUtils.and(new IOFileFilter[] {dirFilter, DirectoryFileFilter.INSTANCE});
 }
Exemplo n.º 3
0
 private static IOFileFilter setUpEffectiveFileFilter(IOFileFilter fileFilter) {
   return FileFilterUtils.and(
       new IOFileFilter[] {
         fileFilter, FileFilterUtils.notFileFilter(DirectoryFileFilter.INSTANCE)
       });
 }