gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 05:30:49 25 4
gpt4 key购买 nike

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

Zip.zipDir介绍

[英]Add a directory to the zip stream.
[中]将目录添加到zip流。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
   * Forces the fixed timestamp for directories to make sure
   * classes.jar always get a consistent checksum.
   */
  protected void zipDir(Resource dir, ZipOutputStream zOut, String vPath,
             int mode, ZipExtraField[] extra)
    throws IOException {
    // use wrappedZOut instead of zOut
    super.zipDir(dir,wrappedZOut,vPath,mode,extra);
  }
};

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

/**
 * Add a directory to the zip stream.
 * @param dir  the directory to add to the archive
 * @param zOut the stream to write to
 * @param vPath the name this entry shall have in the archive
 * @param mode the Unix permissions to set.
 * @throws IOException on error
 * @since Ant 1.5.2
 */
protected void zipDir(final File dir, final ZipOutputStream zOut, final String vPath,
           final int mode)
  throws IOException {
  zipDir(dir, zOut, vPath, mode, null);
}

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

/**
 * Add a directory to the zip stream.
 * @param dir  the directory to add to the archive
 * @param zOut the stream to write to
 * @param vPath the name this entry shall have in the archive
 * @param mode the Unix permissions to set.
 * @param extra ZipExtraFields to add
 * @throws IOException on error
 * @since Ant 1.6.3
 */
protected void zipDir(final File dir, final ZipOutputStream zOut, final String vPath,
           final int mode, final ZipExtraField[] extra)
  throws IOException {
  zipDir(dir == null ? null : new FileResource(dir), zOut, vPath, mode,
    extra);
}

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

f = new File(dir);
zipDir(f, zOut, prefix + dir, dirMode);

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

/**
 * Add a directory entry to the archive using a specified
 * Unix-mode and the default mode for its parent directories (if
 * necessary).
 */
private void addDirectoryResource(final Resource r, String name, final String prefix,
                 final File base, final ZipOutputStream zOut,
                 final int defaultDirMode, final int thisDirMode)
  throws IOException {
  if (!name.endsWith("/")) {
    name += "/";
  }
  final int nextToLastSlash = name.lastIndexOf('/', name.length() - 2);
  if (nextToLastSlash != -1) {
    addParentDirs(base, name.substring(0, nextToLastSlash + 1),
           zOut, prefix, defaultDirMode);
  }
  zipDir(r, zOut, prefix + name, thisDirMode,
      r instanceof ZipResource
      ? ((ZipResource) r).getExtraFields() : null);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
   * Forces the fixed timestamp for directories to make sure
   * classes.jar always get a consistent checksum.
   */
  protected void zipDir(Resource dir, ZipOutputStream zOut, String vPath,
             int mode, ZipExtraField[] extra)
    throws IOException {
    // use wrappedZOut instead of zOut
    super.zipDir(dir,wrappedZOut,vPath,mode,extra);
  }
};

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com