1 21 package proguard.io; 22 23 import java.io.*; 24 import java.util.zip.*; 25 26 32 public class JarReader implements DataEntryReader 33 { 34 DataEntryReader dataEntryReader; 35 36 37 40 public JarReader(DataEntryReader dataEntryReader) 41 { 42 this.dataEntryReader = dataEntryReader; 43 } 44 45 46 48 public void read(DataEntry dataEntry) throws IOException 49 { 50 ZipInputStream zipInputStream = new ZipInputStream(dataEntry.getInputStream()); 51 52 try 53 { 54 while (true) 56 { 57 ZipEntry zipEntry = zipInputStream.getNextEntry(); 59 if (zipEntry == null) 60 { 61 break; 62 } 63 64 if (!zipEntry.isDirectory()) 65 { 66 dataEntryReader.read(new ZipDataEntry(dataEntry, 68 zipEntry, 69 zipInputStream)); 70 } 71 } 72 } 73 finally 74 { 75 dataEntry.closeInputStream(); 76 } 77 } 78 } 79 | Popular Tags |