/** * Copy entry * * @param original - zipEntry to copy * @return copy of the original entry */ static ZipEntry copy(ZipEntry original) { return copy(original, null); }
/** * Copies a given ZIP entry to a ZIP file. If this.preserveTimestamps is true, original timestamp * is carried over, otherwise uses current time. * * @param originalEntry * a ZIP entry from existing ZIP file. * @param in * contents of the ZIP entry. * @param out * target ZIP stream. */ static void copyEntry(ZipEntry originalEntry, InputStream in, ZipOutputStream out, boolean preserveTimestamps) throws IOException { ZipEntry copy = copy(originalEntry); if (preserveTimestamps) { TimestampStrategyFactory.getInstance().setTime(copy, originalEntry); } else { copy.setTime(System.currentTimeMillis()); } addEntry(copy, new BufferedInputStream(in), out); }
entry = ZipEntryUtil.copy(entry, mappedName);
entry = ZipEntryUtil.copy(entry, mappedName);
/** * Copy entry * * @param original - zipEntry to copy * @return copy of the original entry */ static ZipEntry copy(ZipEntry original) { return copy(original, null); }
/** * Copies a given ZIP entry to a ZIP file. If this.preserveTimestamps is true, original timestamp * is carried over, otherwise uses current time. * * @param originalEntry * a ZIP entry from existing ZIP file. * @param in * contents of the ZIP entry. * @param out * target ZIP stream. */ static void copyEntry(ZipEntry originalEntry, InputStream in, ZipOutputStream out, boolean preserveTimestamps) throws IOException { ZipEntry copy = copy(originalEntry); if (preserveTimestamps) { TimestampStrategyFactory.getInstance().setTime(copy, originalEntry); } else { copy.setTime(System.currentTimeMillis()); } addEntry(copy, new BufferedInputStream(in), out); }
entry = ZipEntryUtil.copy(entry, mappedName);
entry = ZipEntryUtil.copy(entry, mappedName);