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(SecuredResource.VIEW_ACTION);
return folder;
}
catch (FolderNotFoundException fnfe)
{
throw fnfe;
}
catch (SecurityException se)
{
throw se;
}
catch (Exception e)
{
throw new FolderNotFoundException("Folder " + folderPath + " not found.", e);
}
}