{
currentFolder = (Folder)currentFolder.getParent();
}
else
{
throw new NodeNotFoundException("Specified path " + path + " not found.");
}
}
else if (!subfolder.equals("."))
{
// access sub-folder or return null if nonexistent
// or access forbidden
try
{
currentFolder = currentFolder.getFolder(subfolder);
}
catch (NodeException ne)
{
NodeNotFoundException nnfe = new NodeNotFoundException("Specified path " + path + " not found.");
nnfe.initCause(ne);
throw nnfe;
}
catch (NodeNotFoundException nnfe)
{
// check security access to folder not found in site view
FolderProxy.getFolderProxy(currentFolder).checkAccessToFolderNotFound(subfolder);
// folder not found in site view
NodeNotFoundException nnfeWrapper = new NodeNotFoundException("Specified path " + path + " not found.");
nnfeWrapper.initCause(nnfe);
throw nnfeWrapper;
}
}
}
else
{
// access remaining path as page, folder, or link node
// proxy; return null if not found or not viewable/visible
// and visibility is required
try
{
NodeSet children = currentFolder.getAll();
if (children != null)
{
Node node = children.get(currentPath);
if ((node != null) && (!onlyVisible || !node.isHidden() || (node == currentPage)) &&
(!onlyViewable || isProxyViewable(node, onlyVisible)))
{
return node;
}
}
}
catch (NodeException ne)
{
NodeNotFoundException nnfe = new NodeNotFoundException("Specified path " + path + " not found.");
nnfe.initCause(ne);
throw nnfe;
}
// check security access to folder node not found in site view
FolderProxy.getFolderProxy(currentFolder).checkAccessToNodeNotFound(currentPath);
// folder node not found in site view
throw new NodeNotFoundException("Specified path " + path + " not found or viewable/visible.");
}
}
// path maps to current folder; return if viewable/visible
// or visibility not required
if ((!onlyVisible || !currentFolder.isHidden()) &&
(!onlyViewable || isProxyViewable(currentFolder, onlyVisible)))
{
return currentFolder;
}
throw new NodeNotFoundException("Specified path " + path + " not found or viewable/visible.");
}