/** * Wraps {@link java.util.zip.ZipEntry#getTime} with a {@link Date} as the * entry's last modified date. * * <p>Changes to the implementation of {@link java.util.zip.ZipEntry#getTime} * leak through and the returned value may depend on your local * time zone as well as your version of Java.</p> */ @Override public Date getLastModifiedDate() { return new Date(getTime()); }
/** * Provides default values for compression method and last * modification time. */ private void setDefaults(final ZipArchiveEntry entry) { if (entry.getMethod() == -1) { // not specified entry.setMethod(method); } if (entry.getTime() == -1) { // not specified entry.setTime(System.currentTimeMillis()); } }
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime());
@Override public long getLastModified() { final long l = zipEntry.getTime(); return l == 0 ? PlexusIoResource.UNKNOWN_MODIFICATION_DATE : l; }
ZipUtil.toDosTime(calendarInstance, ze.getTime(), buf, CFH_TIME_OFFSET);
ZipUtil.toDosTime(calendarInstance, ze.getTime(), buf, LFH_TIME_OFFSET);
ZipArchiveEntry zeOut = new ZipArchiveEntry(ze.getName()); zeOut.setSize(ze.getSize()); zeOut.setTime(ze.getTime()); zos.putArchiveEntry(zeOut); try (final InputStream is = zipEntrySource.getInputStream(ze)) {
private ZipFileResource( JarFile jarFile, ZipArchiveEntry entry ) { super( entry.getName(), entry.getTime() == -1 ? PlexusIoResource.UNKNOWN_MODIFICATION_DATE : entry.getTime(), entry.isDirectory() ? PlexusIoResource.UNKNOWN_RESOURCE_SIZE : entry.getSize(), !entry.isDirectory(), entry.isDirectory(), true ); this.jarFile = jarFile; }
@Override public long getTime() { return archiveEntry.getTime(); } }
ze.getName(), new Date( ze.getTime() ), ze.isDirectory(), ze.getUnixMode() != 0 ? ze.getUnixMode() : null, resolveSymlink( zipFile, ze ), getFileMappers() );
@Override public Date getModifiedDate() { return new Date(zipEntry.getTime()); }
/** * Wraps {@link java.util.zip.ZipEntry#getTime} with a {@link Date} as the * entry's last modified date. * * <p>Changes to the implementation of {@link java.util.zip.ZipEntry#getTime} * leak through and the returned value may depend on your local * time zone as well as your version of Java.</p> */ @Override public Date getLastModifiedDate() { return new Date(getTime()); }
new Date( ze.getTime() ), ze.isDirectory(), ze.getUnixMode() != 0 ? ze.getUnixMode() : null, resolveSymlink( zf, ze ), getFileMappers() );
/** * Provides default values for compression method and last * modification time. */ private void setDefaults(final ZipArchiveEntry entry) { if (entry.getMethod() == -1) { // not specified entry.setMethod(method); } if (entry.getTime() == -1) { // not specified entry.setTime(System.currentTimeMillis()); } }
private void copyZipEntry(ZipFile zipFile, ZipArchiveEntry entry, File copyTo, String key) throws IOException { Cacheable forCache = new Cacheable(entry.getName(), entry.getTime()); log.debug("Checking whether {} is up to date at {}", entry.getName(), copyTo); // Check for modification if (!copyTo.exists() || !cache.isUpToDate(key, forCache)) { log.debug("Up to date check failed, copying {} to {}", entry.getName(), copyTo); ensureIsDirectory(copyTo.getParentFile()); copyAndClose(zipFile.getInputStream(entry), copyTo); if (SystemUtils.IS_OS_UNIX) { int mode = entry.getUnixMode(); if (mode > 0) { Files.setPosixFilePermissions(copyTo.toPath(), toPerms(mode)); } } cache.put(key, forCache); } }
extractFile(fileUtils, srcF, dir, is = zf.getInputStream(ze), ze.getName(), new Date(ze.getTime()), ze.isDirectory(), mapper); } finally {
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime()); zos.putArchiveEntry(zeNew); FilterOutputStream fos2 = new FilterOutputStream(zos) {
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime());
ZipArchiveEntry zeOut = new ZipArchiveEntry(ze.getName()); zeOut.setSize(ze.getSize()); zeOut.setTime(ze.getTime()); zos.putArchiveEntry(zeOut); try (final InputStream is = zipEntrySource.getInputStream(ze)) {