예제 #1
0
 static List<ZLFile> archiveEntries(ZLFile archive) {
   switch (archive.myArchiveType & ArchiveType.ARCHIVE) {
     case ArchiveType.ZIP:
       return ZLZipEntryFile.archiveEntries(archive);
     case ArchiveType.TAR:
       return ZLTarEntryFile.archiveEntries(archive);
     default:
       return Collections.emptyList();
   }
 }
 static List<ZLFile> archiveEntries(ZLFile archive) {
   try {
     final ZipFile zf = ZLZipEntryFile.getZipFile(archive);
     final Collection<LocalFileHeader> headers = zf.headers();
     if (!headers.isEmpty()) {
       ArrayList<ZLFile> entries = new ArrayList<ZLFile>(headers.size());
       for (LocalFileHeader h : headers) {
         entries.add(new ZLZipEntryFile(archive, h.FileName));
       }
       return entries;
     }
   } catch (IOException e) {
   }
   return Collections.emptyList();
 }