{
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
checkAccessToNodeNotFound(currentFolder, 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
// view; 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) && (!onlyConcrete || isConcreteNode(node)) &&
(!onlyVisible || isVisible(node, currentPage)) &&
(!onlyViewable || isViewable(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
checkAccessToNodeNotFound(currentFolder, 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 || isVisible(currentFolder, null)) &&
(!onlyViewable || isViewable(currentFolder, onlyVisible)))
{
return currentFolder;
}
throw new NodeNotFoundException("Specified path " + path + " not found or viewable/visible.");
}