1 21 package proguard.io; 22 23 import java.io.*; 24 import java.util.zip.*; 25 26 import proguard.classfile.ClassConstants; 27 28 33 public class ZipDataEntry implements DataEntry 34 { 35 private DataEntry parent; 36 private ZipEntry zipEntry; 37 private ZipInputStream zipInputStream; 38 39 40 public ZipDataEntry(DataEntry parent, 41 ZipEntry zipEntry, 42 ZipInputStream zipInputStream) 43 { 44 this.parent = parent; 45 this.zipEntry = zipEntry; 46 this.zipInputStream = zipInputStream; 47 } 48 49 50 52 public String getName() 53 { 54 return zipEntry.getName() 56 .replace(File.separatorChar, ClassConstants.INTERNAL_PACKAGE_SEPARATOR); 57 } 58 59 60 public InputStream getInputStream() throws IOException 61 { 62 return zipInputStream; 63 } 64 65 66 public void closeInputStream() throws IOException 67 { 68 zipInputStream.closeEntry(); 69 zipInputStream = null; 70 } 71 72 73 public DataEntry getParent() 74 { 75 return parent; 76 } 77 78 79 81 public String toString() 82 { 83 return parent.toString() + ':' + getName(); 84 } 85 } 86 | Popular Tags |