本文整理了Java中org.apache.tools.zip.ZipEntry.getTime()
方法的一些代码示例,展示了ZipEntry.getTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.getTime()
方法的具体详情如下:
包路径:org.apache.tools.zip.ZipEntry
类名称:ZipEntry
方法名:getTime
暂无
代码示例来源:origin: org.apache.ant/ant
/** {@inheritDoc} */
public Date getLastModifiedDate() {
return new Date(getTime());
}
代码示例来源:origin: org.apache.ant/ant
/**
* Provides default values for compression method and last
* modification time.
*
* @param entry ZipEntry
*/
private void setDefaults(ZipEntry entry) {
if (entry.getMethod() == -1) { // not specified
entry.setMethod(method);
}
if (entry.getTime() == -1) { // not specified
entry.setTime(System.currentTimeMillis());
}
}
代码示例来源:origin: jenkinsci/jenkins
LOGGER.log(Level.WARNING, "unable to set permissions", ex);
f.setLastModified(e.getTime());
代码示例来源:origin: org.apache.ant/ant
extractFile(fileUtils, srcF, dir,
ze.getName(), new Date(ze.getTime()),
ze.isDirectory(), mapper);
} finally {
代码示例来源:origin: org.apache.ant/ant
ZipUtil.toDosTime(calendarInstance, ze.getTime(), buf, LFH_TIME_OFFSET);
代码示例来源: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
otherComment = "";
return getTime() == other.getTime()
&& myComment.equals(otherComment)
&& getInternalAttributes() == other.getInternalAttributes()
代码示例来源:origin: org.apache.ant/ant
ZipUtil.toDosTime(calendarInstance, ze.getTime(), buf, CFH_TIME_OFFSET);
代码示例来源:origin: org.apache.ant/ant
private void setEntry(ZipEntry e) {
if (e == null) {
setExists(false);
return;
}
setName(e.getName());
setExists(true);
setLastModified(e.getTime());
setDirectory(e.isDirectory());
setSize(e.getSize());
setMode(e.getUnixMode());
extras = e.getExtraFields(true);
method = e.getMethod();
}
代码示例来源:origin: org.gradle/gradle-core
public long getLastModified() {
return entry.getTime();
}
代码示例来源:origin: com.github.javahaohao/utils
.append(" KB!").append("\r\n");
} else {
long entrytime = entry.getTime();
long localtime = destFile.lastModified();
long entrysize = entry.getSize();
fileOut.close();
inputStream.close();
destFile.setLastModified(entry.getTime());
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
LOGGER.log(Level.WARNING, "unable to set permissions", ex);
f.setLastModified(e.getTime());
内容来源于网络,如有侵权,请联系作者删除!