本文整理了Java中java.util.zip.ZipEntry.setLastAccessTime()
方法的一些代码示例,展示了ZipEntry.setLastAccessTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntry.setLastAccessTime()
方法的具体详情如下:
包路径:java.util.zip.ZipEntry
类名称:ZipEntry
方法名:setLastAccessTime
暂无
代码示例来源:origin: zeroturnaround/zt-zip
public void setTime(ZipEntry newInstance, ZipEntry oldInstance) {
{
FileTime time = oldInstance.getCreationTime();
if (time != null) {
newInstance.setCreationTime(time);
}
}
{
FileTime time = oldInstance.getLastModifiedTime();
if (time != null) {
newInstance.setLastModifiedTime(time);
}
}
{
FileTime time = oldInstance.getLastAccessTime();
if (time != null) {
newInstance.setLastAccessTime(time);
}
}
}
代码示例来源:origin: com.github.bloodshura/shurax
public void setLastAccessTime(@Nonnull Instant lastAccessTime) {
getHandle().setLastAccessTime(FileTime.from(lastAccessTime));
}
代码示例来源:origin: com.github.bloodshura/ignitium-core
public void setLastAccessTime(@Nonnull Instant lastAccessTime) {
getHandle().setLastAccessTime(FileTime.from(lastAccessTime));
}
代码示例来源:origin: CoffeePartner/capt
/**
* write ZIP faster without compress!
*/
final void writeTo(ZipOutputStream zos) throws IOException {
ZipEntry outEntry = new ZipEntry(name);
CRC32 crc32 = new CRC32();
crc32.update(bytes);
outEntry.setCrc(crc32.getValue());
outEntry.setMethod(ZipEntry.STORED);
outEntry.setSize(bytes.length);
outEntry.setCompressedSize(bytes.length);
outEntry.setLastAccessTime(ZERO);
outEntry.setLastModifiedTime(ZERO);
outEntry.setCreationTime(ZERO);
zos.putNextEntry(outEntry);
zos.write(bytes);
}
代码示例来源:origin: org.zeroturnaround/zt-zip
public void setTime(ZipEntry newInstance, ZipEntry oldInstance) {
{
FileTime time = oldInstance.getCreationTime();
if (time != null) {
newInstance.setCreationTime(time);
}
}
{
FileTime time = oldInstance.getLastModifiedTime();
if (time != null) {
newInstance.setLastModifiedTime(time);
}
}
{
FileTime time = oldInstance.getLastAccessTime();
if (time != null) {
newInstance.setLastAccessTime(time);
}
}
}
代码示例来源:origin: docbleach/DocBleach
private ZipEntry cloneEntry(ZipEntry entry) {
ZipEntry newEntry = new ZipEntry(entry.getName());
newEntry.setTime(entry.getTime());
if (entry.getCreationTime() != null) {
newEntry.setCreationTime(entry.getCreationTime());
}
if (entry.getLastModifiedTime() != null) {
newEntry.setLastModifiedTime(entry.getLastModifiedTime());
}
if (entry.getLastAccessTime() != null) {
newEntry.setLastAccessTime(entry.getLastAccessTime());
}
newEntry.setComment(entry.getComment());
newEntry.setExtra(entry.getExtra());
return newEntry;
}
}
内容来源于网络,如有侵权,请联系作者删除!