java.util.zip.ZipEntry.clone()方法的使用及代码示例

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

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

ZipEntry.clone介绍

[英]Returns a deep copy of this zip entry.
[中]返回此zip条目的深度副本。

代码示例

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

/**
 * Overwrite clone.
 * @return a cloned copy of this ZipArchiveEntry
 */
@Override
public Object clone() {
  final ZipArchiveEntry e = (ZipArchiveEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getAllExtraFieldsNoCopy());
  return e;
}

代码示例来源:origin: alibaba/mdrill

/**
 * Overwrite clone.
 * @return a cloned copy of this ZipEntry
 * @since 1.1
 */
@Override
public Object clone() {
  ZipEntry e = (ZipEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getExtraFields(true));
  return e;
}

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

/**
 * Overwrite clone.
 *
 * @return a cloned copy of this ZipEntry
 * @since 1.1
 */
@Override
public Object clone() {
  final ZipEntry e = (ZipEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getAllExtraFieldsNoCopy());
  return e;
}

代码示例来源:origin: io.github.jiri-meluzin/io.github.jiri-meluzin.tibcobwutils.earcomparer

public void updateFile(Path outputPath, List<T.V3<String, byte[], ZipEntry>> files) {
  try (ZipOutputStream zipFile = new ZipOutputStream(new FileOutputStream(outputPath.toFile()))) {
    for (V3<String, byte[], ZipEntry> v : files) {
      ZipEntry zipEntry = (ZipEntry)v.getC().clone();
      zipEntry.setCompressedSize(-1);
      zipEntry.setSize(v.getB().length);
      zipFile.putNextEntry(zipEntry);
      zipFile.write(v.getB());
    }
  } catch (IOException e) {
    throw new RuntimeException("Cannot store zip file ("+outputPath+")" + e.getMessage(), e);
  }
}
public static Comparator<? super V2<String, byte[]>> fileListComparator() {

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Overwrite clone.
 * @return a cloned copy of this ZipArchiveEntry
 */
@Override
public Object clone() {
  final ZipArchiveEntry e = (ZipArchiveEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getAllExtraFieldsNoCopy());
  return e;
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

/**
 * Overwrite clone.
 * @return a cloned copy of this ZipArchiveEntry
 */
@Override
public Object clone() {
  final ZipArchiveEntry e = (ZipArchiveEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getAllExtraFieldsNoCopy());
  return e;
}

代码示例来源:origin: org.xbib/archive

/**
 * Overwrite clone.
 *
 * @return a cloned copy of this ZipArchiveEntry
 */
@Override
public Object clone() {
  ZipArchiveEntry e = (ZipArchiveEntry) super.clone();
  e.setInternalAttributes(getInternalAttributes());
  e.setExternalAttributes(getExternalAttributes());
  e.setExtraFields(getExtraFields(true));
  return e;
}

相关文章