org.apache.commons.io.FileUtils.innerListFiles()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(207)

本文整理了Java中org.apache.commons.io.FileUtils.innerListFiles()方法的一些代码示例,展示了FileUtils.innerListFiles()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.innerListFiles()方法的具体详情如下:
包路径:org.apache.commons.io.FileUtils
类名称:FileUtils
方法名:innerListFiles

FileUtils.innerListFiles介绍

[英]Finds files within a given directory (and optionally its subdirectories). All files found are filtered by an IOFileFilter.
[中]查找给定目录(及其子目录)中的文件。找到的所有文件都由IOFileFilter筛选。

代码示例

代码示例来源:origin: commons-io/commons-io

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files                 the collection of files found.
 * @param directory             the directory to search in.
 * @param filter                the filter to apply to files and directories.
 * @param includeSubDirectories indicates if will include the subdirectories themselves
 */
private static void innerListFiles(final Collection<File> files, final File directory,
                  final IOFileFilter filter, final boolean includeSubDirectories) {
  final File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (final File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files, file, filter, includeSubDirectories);
      } else {
        files.add(file);
      }
    }
  }
}

代码示例来源:origin: org.apache.commons/commons-io

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files the collection of files found.
 * @param directory the directory to search in.
 * @param filter the filter to apply to files and directories.
 */
private static void innerListFiles(Collection files, File directory,
    IOFileFilter filter) {
  File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (int i = 0; i < found.length; i++) {
      if (found[i].isDirectory()) {
        innerListFiles(files, found[i], filter);
      } else {
        files.add(found[i]);
      }
    }
  }
}

代码示例来源:origin: commons-io/commons-io

files.add(directory);
innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;

代码示例来源:origin: commons-io/commons-io

innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), false);
return files;

代码示例来源:origin: org.apache.commons/commons-io

innerListFiles(files, directory,
  FileFilterUtils.orFileFilter(effFileFilter, effDirFilter));
return files;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files the collection of files found.
 * @param directory the directory to search in.
 * @param filter the filter to apply to files and directories.
 */
private static void innerListFiles(Collection files, File directory,
    IOFileFilter filter) {
  File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (int i = 0; i < found.length; i++) {
      if (found[i].isDirectory()) {
        innerListFiles(files, found[i], filter);
      } else {
        files.add(found[i]);
      }
    }
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files the collection of files found.
 * @param directory the directory to search in.
 * @param filter the filter to apply to files and directories.
 */
private static void innerListFiles(Collection files, File directory,
    IOFileFilter filter) {
  File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (int i = 0; i < found.length; i++) {
      if (found[i].isDirectory()) {
        innerListFiles(files, found[i], filter);
      } else {
        files.add(found[i]);
      }
    }
  }
}

代码示例来源:origin: Nextdoor/bender

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files the collection of files found.
 * @param directory the directory to search in.
 * @param filter the filter to apply to files and directories.
 * @param includeSubDirectories indicates if will include the subdirectories themselves
 */
private static void innerListFiles(Collection<File> files, File directory,
    IOFileFilter filter, boolean includeSubDirectories) {
  File[] found = directory.listFiles((FileFilter) filter);
  
  if (found != null) {
    for (File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files, file, filter, includeSubDirectories);
      } else {
        files.add(file);
      }
    }
  }
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files the collection of files found.
 * @param directory the directory to search in.
 * @param filter the filter to apply to files and directories.
 * @param includeSubDirectories indicates if will include the subdirectories themselves
 */
private static void innerListFiles(Collection<File> files, File directory,
    IOFileFilter filter, boolean includeSubDirectories) {
  File[] found = directory.listFiles((FileFilter) filter);
  
  if (found != null) {
    for (File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files, file, filter, includeSubDirectories);
      } else {
        files.add(file);
      }
    }
  }
}

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files                 the collection of files found.
 * @param directory             the directory to search in.
 * @param filter                the filter to apply to files and directories.
 * @param includeSubDirectories indicates if will include the subdirectories themselves
 */
private static void innerListFiles(final Collection<File> files, final File directory,
                  final IOFileFilter filter, final boolean includeSubDirectories) {
  final File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (final File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files, file, filter, includeSubDirectories);
      } else {
        files.add(file);
      }
    }
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Finds files within a given directory (and optionally its
 * subdirectories). All files found are filtered by an IOFileFilter.
 *
 * @param files                 the collection of files found.
 * @param directory             the directory to search in.
 * @param filter                the filter to apply to files and directories.
 * @param includeSubDirectories indicates if will include the subdirectories themselves
 */
private static void innerListFiles(final Collection<File> files, final File directory,
                  final IOFileFilter filter, final boolean includeSubDirectories) {
  final File[] found = directory.listFiles((FileFilter) filter);
  if (found != null) {
    for (final File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files, file, filter, includeSubDirectories);
      } else {
        files.add(file);
      }
    }
  }
}

代码示例来源:origin: Nextdoor/bender

files.add(directory);
innerListFiles(files, directory,
  FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

files.add(directory);
innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

files.add(directory);
innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;

代码示例来源:origin: org.onosproject/onlab-thirdparty

files.add(directory);
innerListFiles(files, directory,
  FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io

innerListFiles(files, directory,
  FileFilterUtils.orFileFilter(effFileFilter, effDirFilter));
return files;

代码示例来源:origin: Nextdoor/bender

innerListFiles(files, directory,
  FileFilterUtils.or(effFileFilter, effDirFilter), false);
return files;

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), false);
return files;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

innerListFiles(files, directory,
    FileFilterUtils.or(effFileFilter, effDirFilter), false);
return files;

代码示例来源:origin: org.onosproject/onlab-thirdparty

innerListFiles(files, directory,
  FileFilterUtils.or(effFileFilter, effDirFilter), false);
return files;

相关文章

FileUtils类方法