1 11 12 package org.eclipse.osgi.baseadaptor.bundlefile; 13 14 import java.io.File ; 15 import java.io.IOException ; 16 import java.util.Enumeration ; 17 18 30 public class NestedDirBundleFile extends BundleFile { 31 BundleFile baseBundleFile; 32 String cp; 33 34 39 public NestedDirBundleFile(BundleFile baseBundlefile, String cp) { 40 super(baseBundlefile.basefile); 41 this.baseBundleFile = baseBundlefile; 42 this.cp = cp; 43 if (cp.charAt(cp.length() - 1) != '/') { 44 this.cp = this.cp + '/'; 45 } 46 } 47 48 public void close() { 49 } 51 52 public BundleEntry getEntry(String path) { 53 if (path.length() > 0 && path.charAt(0) == '/') 54 path = path.substring(1); 55 String newpath = new StringBuffer (cp).append(path).toString(); 56 return baseBundleFile.getEntry(newpath); 57 } 58 59 public boolean containsDir(String dir) { 60 if (dir == null) 61 return false; 62 63 if (dir.length() > 0 && dir.charAt(0) == '/') 64 dir = dir.substring(1); 65 String newdir = new StringBuffer (cp).append(dir).toString(); 66 return baseBundleFile.containsDir(newdir); 67 } 68 69 public Enumeration getEntryPaths(String path) { 70 return null; 72 } 73 74 public File getFile(String entry, boolean nativeCode) { 75 return null; 77 } 78 79 public void open() throws IOException { 80 } 82 } 83 | Popular Tags |