net.lingala.zip4j.util.Zip4jUtil.getFilesInDirectoryRec()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(183)

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

Zip4jUtil.getFilesInDirectoryRec介绍

暂无

代码示例

代码示例来源:origin: net.lingala.zip4j/zip4j

public static ArrayList getFilesInDirectoryRec(File path, 
    boolean readHiddenFiles) throws ZipException {
  
  if (path == null) {
    throw new ZipException("input path is null, cannot read files in the directory");
  }
  
  ArrayList result = new ArrayList();
  File[] filesAndDirs = path.listFiles();
  List filesDirs = Arrays.asList(filesAndDirs);
  
  if (!path.canRead()) {
    return result; 
  }
  
  for(int i = 0; i < filesDirs.size(); i++) {
    File file = (File)filesDirs.get(i);
    if (file.isHidden() && !readHiddenFiles) {
      return result;
    }
    result.add(file);
    if (file.isDirectory()) {
      List deeperList = getFilesInDirectoryRec(file, readHiddenFiles);
      result.addAll(deeperList);
    }
  }
  return result;
}

代码示例来源:origin: com.github.axet/zip4j

public static ArrayList getFilesInDirectoryRec(NativeStorage path, 
    boolean readHiddenFiles) throws ZipException {
  
  if (path == null) {
    throw new ZipException("input path is null, cannot read files in the directory");
  }
  
  ArrayList result = new ArrayList();
  NativeStorage[] filesAndDirs = path.listFiles();
  List filesDirs = Arrays.asList(filesAndDirs);
  
  if (!path.canRead()) {
    return result; 
  }
  
  for(int i = 0; i < filesDirs.size(); i++) {
    NativeStorage file = (NativeStorage)filesDirs.get(i);
    if (file.isHidden() && !readHiddenFiles) {
      return result;
    }
    result.add(file);
    if (file.isDirectory()) {
      List deeperList = getFilesInDirectoryRec(file, readHiddenFiles);
      result.addAll(deeperList);
    }
  }
  return result;
}

代码示例来源:origin: net.lingala.zip4j/zip4j

ArrayList fileList = Zip4jUtil.getFilesInDirectoryRec(file, parameters.isReadHiddenFiles());

代码示例来源:origin: com.github.axet/zip4j

ArrayList fileList = Zip4jUtil.getFilesInDirectoryRec(file, parameters.isReadHiddenFiles());

相关文章