Пример #1
0
  /**
   * 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(getAllExtraFieldsNoCopy());
    return e;
  }
Пример #2
0
 /**
  * Creates a new zip entry with fields taken from the specified zip entry.
  *
  * <p>Assumes the entry represents a directory if and only if the name ends with a forward slash
  * "/".
  *
  * @param entry the entry to get fields from
  * @throws ZipException on error
  */
 public ZipArchiveEntry(ZipArchiveEntry entry) throws ZipException {
   this((java.util.zip.ZipEntry) entry);
   setInternalAttributes(entry.getInternalAttributes());
   setExternalAttributes(entry.getExternalAttributes());
   setExtraFields(getAllExtraFieldsNoCopy());
   setPlatform(entry.getPlatform());
   GeneralPurposeBit other = entry.getGeneralPurposeBit();
   setGeneralPurposeBit(other == null ? null : (GeneralPurposeBit) other.clone());
 }