org.apache.tools.ant.taskdefs.Jar.zipFile()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(109)

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

Jar.zipFile介绍

[英]Overridden from Zip class to deal with manifests and index lists.
[中]从Zip类重写以处理清单和索引列表。

代码示例

代码示例来源:origin: org.apache.ant/ant

Project.MSG_WARN);
} else {
  super.zipFile(file, zOut, vPath, mode);
  descriptorAdded = true;
super.zipFile(file, zOut, vPath, mode);

代码示例来源:origin: org.apache.ant/ant

super.zipFile(file, zOut, vPath, mode);

代码示例来源:origin: org.sonatype.plugins/jarjar-maven-plugin

protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath,
                 long lastModified, File fromArchive, int mode) throws IOException {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  IoUtil.pipe(is, baos, buf);
  struct.data = baos.toByteArray();
  struct.name = vPath;
  struct.time = lastModified;
  if (proc.process(struct)) {
    if (mode == 0)
      mode = ZipFileSet.DEFAULT_FILE_MODE;
    if (!filesOnly) {
     addParentDirs(struct.name, zOut);
    }
    super.zipFile(new ByteArrayInputStream(struct.data),
           zOut, struct.name, struct.time, fromArchive, mode);
  }
}

相关文章