This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
import java.util.StringTokenizer;
/** Retrieve file or folder contained in this folder by name (no extension
/** Retrieve file or folder relative to a current folder, with a given rel
--
* @param name basename of the file (in this folder)
* @param relativePath is just basename of the file or the relative path de
public final FileObject getFileObject (String name) {
public final FileObject getFileObject (String relativePath) {
return getFileObject (name, null);
if (relativePath.startsWith("/")) {
relativePath = relativePath.substring(1);
}
FileObject myObj = this;
StringTokenizer st = new StringTokenizer(relativePath, "/");
while (myObj != null && st.hasMoreTokens()) {
myObj = myObj.getFileObject(st.nextToken(), null);
return myObj;