Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 19 20 package org.netbeans.modules.masterfs; 21 22 import org.openide.filesystems.FileObject; 23 24 28 abstract class BasedOnResourcePath extends FileObject { 29 30 static final long serialVersionUID = -1244651311117356809L; 31 32 protected ResourcePath resourceNameObj; 33 34 BasedOnResourcePath (ResourcePath resourceNameObj) { 35 this.resourceNameObj = resourceNameObj; 36 } 37 38 public String getNameExt () { 39 return resourceNameObj.getNameExt (); 40 } 41 44 public String getExt() { 45 return resourceNameObj.getExt(); 46 } 47 48 51 public String getName() { 52 return resourceNameObj.getName(); 53 } 54 55 public String getPath() { 56 String p = resourceNameObj.getPath(); 57 assert !p.startsWith("/") : p; 58 return p; 59 } 60 61 ResourcePath getResource() { 62 return resourceNameObj; 63 } 64 65 void setResource(ResourcePath newName) { 66 String oldName = resourceNameObj.getNormalizedPath(); 67 resourceNameObj = newName; 68 } 69 70 73 public boolean isRoot() { 74 return (getResource().getParent() == null) ? true : false; 75 } 76 77 } 78
| Popular Tags
|