gpt4 book ai didi

org.apache.tools.ant.types.resources.ZipResource.getExtraFields()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:38:27 26 4
gpt4 key购买 nike

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

ZipResource.getExtraFields介绍

[英]Retrieves extra fields.
[中]检索额外字段。

代码示例

代码示例来源: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.apache.ant/ant

/**
 * Retrieves extra fields.
 * @return an array of the extra fields
 * @since Ant 1.8.0
 */
public ZipExtraField[] getExtraFields() {
  if (isReference()) {
    return ((ZipResource) getCheckedRef()).getExtraFields();
  }
  checkEntry();
  if (extras == null) {
    return new ZipExtraField[0];
  }
  return extras;
}

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

/**
 * Add a file entry.
 */
private void addResource(final Resource r, final String name, final String prefix,
             final ZipOutputStream zOut, final int mode,
             final ZipFile zf, final File fromArchive)
  throws IOException {
  if (zf != null) {
    final ZipEntry ze = zf.getEntry(r.getName());
    if (ze != null) {
      final boolean oldCompress = doCompress;
      if (keepCompression) {
        doCompress = (ze.getMethod() == ZipEntry.DEFLATED);
      }
      try (final BufferedInputStream is = new BufferedInputStream(zf.getInputStream(ze))) {
        zipFile(is, zOut, prefix + name, ze.getTime(),
            fromArchive, mode, ze.getExtraFields(true));
      } finally {
        doCompress = oldCompress;
      }
    }
  } else {
    try (final BufferedInputStream is = new BufferedInputStream(r.getInputStream())) {
      zipFile(is, zOut, prefix + name, r.getLastModified(),
          fromArchive, mode, r instanceof ZipResource
          ? ((ZipResource) r).getExtraFields() : null);
    }
  }
}

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

(org.apache.tools.ant.types.resources.ZipResource) r;
org.apache.tools.zip.ZipExtraField[] extra = zr.getExtraFields();
ZipExtraField[] ex =
  new ZipExtraField[extra == null ? 0 : extra.length];

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