1 11 12 package org.eclipse.osgi.baseadaptor.bundlefile; 13 14 import java.io.IOException ; 15 import java.io.InputStream ; 16 import java.net.MalformedURLException ; 17 import java.net.URL ; 18 19 25 public class DirZipBundleEntry extends BundleEntry { 26 27 30 private ZipBundleFile bundleFile; 31 34 String name; 35 36 public DirZipBundleEntry(ZipBundleFile bundleFile, String name) { 37 this.name = (name.length() > 0 && name.charAt(0) == '/') ? name.substring(1) : name; 38 this.bundleFile = bundleFile; 39 } 40 41 public InputStream getInputStream() throws IOException { 42 return null; 43 } 44 45 public long getSize() { 46 return 0; 47 } 48 49 public String getName() { 50 return name; 51 } 52 53 public long getTime() { 54 return 0; 55 } 56 57 public URL getLocalURL() { 58 try { 59 return new URL ("jar:file:" + bundleFile.basefile.getAbsolutePath() + "!/" + name); } catch (MalformedURLException e) { 61 return null; 63 } 64 } 65 66 public URL getFileURL() { 67 try { 68 return bundleFile.extractDirectory(name).toURL(); 69 } catch (MalformedURLException e) { 70 return null; 72 } 73 } 74 } 75 | Popular Tags |