Folder folder = (Folder)getPersistenceBrokerTemplate().getObjectByQuery(query);
// return folder or throw exception
if (folder == null)
{
throw new FolderNotFoundException("Folder " + folderPath + " not found.");
}
// check for view access on folder
folder.checkAccess(JetspeedActions.VIEW);
return folder;
}
catch (FolderNotFoundException fnfe)
{
throw fnfe;
}
catch (SecurityException se)
{
throw se;
}
catch (Exception e)
{
throw new FolderNotFoundException("Folder " + folderPath + " not found.", e);
}
}