1 19 20 package org.netbeans.core.projects; 21 22 import org.openide.filesystems.*; 23 import java.beans.PropertyVetoException ; 24 import java.io.IOException ; 25 import org.openide.util.Exceptions; 26 27 32 public final class FilterFileSystem extends MultiFileSystem { 33 34 private final FileObject root; 35 private final FileSystem del; 36 37 public FilterFileSystem (FileObject root) throws FileStateInvalidException { 38 super (new FileSystem [] { root.getFileSystem () }); 39 this.root = root; 40 this.del = root.getFileSystem (); 41 setSystemName(); 42 setPropagateMasks (true); 43 } 44 45 @SuppressWarnings ("deprecation") 46 private void setSystemName() { 47 try { 48 setSystemName(del.getSystemName() + " : " + root.getPath()); } catch (PropertyVetoException e) { 50 Exceptions.printStackTrace(e); 52 } 53 } 54 55 public final FileObject getRootFileObject () { 56 return root; 57 } 58 59 protected FileObject findResourceOn (FileSystem fs, String res) { 60 return fs.findResource (root.getPath() + "/" + res); } 62 63 protected java.util.Set createLocksOn (String name) throws IOException { 64 String nn = root.getPath() + "/" + name; 65 org.netbeans.core.startup.layers.LocalFileSystemEx.potentialLock (name, nn); 66 return super.createLocksOn (name); 67 } 68 } 69 | Popular Tags |