1 6 21 22 package de.schlichtherle.io.archive.zip; 23 24 import de.schlichtherle.io.*; 25 import de.schlichtherle.io.archive.spi.*; 26 import de.schlichtherle.io.rof.*; 27 import de.schlichtherle.io.util.*; 28 import de.schlichtherle.util.zip.*; 29 import de.schlichtherle.util.zip.ZipEntry; 30 31 import java.io.*; 32 import java.util.*; 33 import java.util.zip.*; 34 35 44 public class Zip32InputArchive 45 extends BasicZipFile 46 implements InputArchive { 47 48 private InputArchiveMetaData metaData; 49 50 public Zip32InputArchive( 51 ReadOnlyFile rof, 52 String encoding, 53 boolean preambled, 54 boolean postambled) 55 throws NullPointerException , 56 UnsupportedEncodingException, 57 FileNotFoundException, 58 ZipException, 59 IOException { 60 super(rof, encoding, preambled, postambled); 61 } 62 63 protected ZipEntry createZipEntry(String name) { 64 return new Zip32Entry(Paths.normalize(name, '/')); 65 } 66 67 public int getNumArchiveEntries() { 68 return super.size(); 69 } 70 71 public Enumeration getArchiveEntries() { 72 return super.entries(); 73 } 74 75 public ArchiveEntry getArchiveEntry(final String name) { 76 return (Zip32Entry) super.getEntry(name); 77 } 78 79 public InputStream getInputStream( 80 final ArchiveEntry entry, 81 final ArchiveEntry dstEntry) 82 throws IOException { 83 return super.getInputStream( 84 entry.getName(), false, !(dstEntry instanceof Zip32Entry)); 85 } 86 87 91 public InputArchiveMetaData getMetaData() { 92 return metaData; 93 } 94 95 public void setMetaData(InputArchiveMetaData metaData) { 96 this.metaData = metaData; 97 } 98 } 99 | Popular Tags |