1 19 20 package org.netbeans.modules.javacore.scanning; 21 import java.io.IOException ; 22 23 import java.io.InputStream ; 24 import java.util.zip.ZipEntry ; 25 import java.util.zip.ZipFile ; 26 30 class ZipEntryInfo implements FileInfo { 31 private ZipEntry entry; 32 private ZipFile file; 33 private String name; 34 private String path; 35 36 public ZipEntryInfo(ZipFile f,ZipEntry en,String shortName, String pathToRoot) { 37 entry=en; 38 file=f; 39 name=shortName; 40 path = pathToRoot; 41 } 42 43 public InputStream getInputStream() throws IOException { 44 return file.getInputStream(entry); 45 } 46 47 public String getName() { 48 return name; 49 } 50 51 public boolean isDirectory() { 52 return false; 53 } 54 55 public long lastModified() { 56 return entry.getTime(); 57 } 58 59 public FileInfo[] listFiles() { 60 return EMPTY_ARR; 61 } 62 63 public String getPath() { 64 return path; 65 } 66 67 public String getCanonicalName() { 68 return null; 69 } 70 } 71 | Popular Tags |