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

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

本文整理了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

  1. Project.MSG_WARN);
  2. } else {
  3. super.zipFile(file, zOut, vPath, mode);
  4. descriptorAdded = true;
  5. super.zipFile(file, zOut, vPath, mode);

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

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

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

  1. protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath,
  2. long lastModified, File fromArchive, int mode) throws IOException {
  3. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  4. IoUtil.pipe(is, baos, buf);
  5. struct.data = baos.toByteArray();
  6. struct.name = vPath;
  7. struct.time = lastModified;
  8. if (proc.process(struct)) {
  9. if (mode == 0)
  10. mode = ZipFileSet.DEFAULT_FILE_MODE;
  11. if (!filesOnly) {
  12. addParentDirs(struct.name, zOut);
  13. }
  14. super.zipFile(new ByteArrayInputStream(struct.data),
  15. zOut, struct.name, struct.time, fromArchive, mode);
  16. }
  17. }

相关文章