gpt4 book ai didi

org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLastModifiedDate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 06:42:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveEntry.getLastModifiedDate()方法的一些代码示例,展示了ZipArchiveEntry.getLastModifiedDate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveEntry.getLastModifiedDate()方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveEntry
类名称:ZipArchiveEntry
方法名:getLastModifiedDate

ZipArchiveEntry.getLastModifiedDate介绍

[英]Wraps java.util.zip.ZipEntry#getTime with a Date as the entry's last modified date.

Changes to the implementation of java.util.zip.ZipEntry#getTimeleak through and the returned value may depend on your local time zone as well as your version of Java.
[中]包装java。util。拉链ZipEntry#getTime,日期作为条目的最后修改日期。
对java实现的更改。util。拉链ZipEntry#getTimeleak-through和返回值可能取决于您的本地时区以及您的Java版本。

代码示例

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

private static long getLastModofied( ZipArchiveEntry entry )
{
  long l = entry.getLastModifiedDate().getTime();
  return l == -1 ? PlexusIoResource.UNKNOWN_MODIFICATION_DATE : l;
}

代码示例来源:origin: com.madgag/util-compress

public static void unzip(InputStream rawZipFileInputStream, File destinationDirectory) throws IOException, ArchiveException {
  ZipArchiveInputStream archiveInputStream = new ZipArchiveInputStream(rawZipFileInputStream);
  ZipArchiveEntry entry;
  while ((entry=archiveInputStream.getNextZipEntry())!=null) {
    File entryDestinationFile = new File(destinationDirectory, entry.getName());
    if (entry.isDirectory()) {
      entryDestinationFile.mkdirs();
    } else {
      FileOutputStream inflatedFileOutputStream = openOutputStream(entryDestinationFile);
      try {
        copy(new BoundedInputStream(archiveInputStream, entry.getSize()), inflatedFileOutputStream);
      } finally {
        closeQuietly(inflatedFileOutputStream); // don't close BoundedInputStream - throw it away, don't propagate close!
      }
    }
    entryDestinationFile.setLastModified(entry.getLastModifiedDate().getTime());
  }
  closeQuietly(archiveInputStream);
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com