net.lingala.zip4j.core.ZipFile.getFileHeaders()方法的使用及代码示例

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

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

ZipFile.getFileHeaders介绍

[英]Returns the list of file headers in the zip file. Throws an exception if the zip file does not exist
[中]返回zip文件中的文件头列表。如果zip文件不存在,则引发异常

代码示例

代码示例来源:origin: org.jboss.forge.addon/resources-impl

@Override
@SuppressWarnings("unchecked")
protected List<Resource<?>> doListResources()
{
 List<Resource<?>> entries = new ArrayList<>();
 try
 {
   List<FileHeader> fileHeaders = zipFile.getFileHeaders();
   for (FileHeader fileHeader : fileHeaders)
   {
    entries.add(new ZipFileResourceEntryImpl(getResourceFactory(), this, fileHeader));
   }
 }
 catch (ZipException e)
 {
   throw new ResourceException("Error while listing children", e);
 }
 return entries;
}

代码示例来源:origin: StannyBing/ZXUtils

final int total = zipFile.getFileHeaders().size();
int progressNow = -1;
for (int i = 0; i < zipFile.getFileHeaders().size(); i++) {
  fileHeader = (FileHeader) zipFile.getFileHeaders().get(i);
  zipFile.extractFile(fileHeader, outputPath);
  int progress = (int) ((i + 1) * 1.0 * 100 / total);

代码示例来源:origin: SpringCloud/spring-cloud-codegen

List<FileHeader> headerList = zFile.getFileHeaders();
List<File> extractedFileList = new ArrayList<File>();
for (FileHeader fileHeader : headerList) {

代码示例来源:origin: io.thorntail/tools

@SuppressWarnings("unchecked")
private void expandArtifact(File artifactFile) throws IOException {
  try {
    ZipFile zipFile = new ZipFile(artifactFile);
    for (FileHeader each : (List<FileHeader>) zipFile.getFileHeaders()) {
      if (each.getFileName().startsWith("META-INF")) {
        continue;
      }
      if (each.isDirectory()) {
        continue;
      }
      this.archive.add(new ZipFileHeaderAsset(zipFile, each), each.getFileName());
    }
  } catch (ZipException e) {
    throw new IOException(e);
  }
}

代码示例来源:origin: org.wildfly.swarm/tools

@SuppressWarnings("unchecked")
private void expandArtifact(File artifactFile) throws IOException {
  try {
    ZipFile zipFile = new ZipFile(artifactFile);
    for (FileHeader each : (List<FileHeader>) zipFile.getFileHeaders()) {
      if (each.getFileName().startsWith("META-INF")) {
        continue;
      }
      if (each.isDirectory()) {
        continue;
      }
      this.archive.add(new ZipFileHeaderAsset(zipFile, each), each.getFileName());
    }
  } catch (ZipException e) {
    throw new IOException(e);
  }
}

代码示例来源:origin: Nepxion/Skeleton

List<FileHeader> headerList = zFile.getFileHeaders();
List<File> extractedFileList = new ArrayList<File>();
for (FileHeader fileHeader : headerList) {

代码示例来源:origin: MCMrARM/revolution-irc

for (Object header : zipFile.getFileHeaders()) {
  if (!(header instanceof FileHeader))
    continue;

相关文章