protected String[] getChildrenNames( String path, FilenameFilter filter ) throws FolderNotFoundException { File parent = new File(documentRootDir, path); if (!parent.exists()) { throw new FolderNotFoundException("No folder exists at the path: " + parent.getAbsolutePath()); } else { if (filter != null) { return parent.list(filter); } else { return parent.list(); } } }
/** * <p> * getPageSecurity * </p> * * @see org.apache.jetspeed.page.PageManager#getPageSecurity() * @return page security instance * @throws DocumentNotFoundException * @throws UnsupportedDocumentTypeException * @throws NodeException */ public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException { // get page security via folder, (always allow access) try { FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR); return folder.getPageSecurity(); } catch (FolderNotFoundException fnfe) { throw new DocumentNotFoundException(fnfe.getMessage()); } }
/** * createRootFolderView - create and return root folder view instance * * @return root folder view * @throws FolderNotFoundException if not found * @throws SecurityException if view access not granted */ protected Folder createRootFolderView() throws FolderNotFoundException { try { // get concrete root folder from page manager return getPageManager().getFolder(Folder.PATH_SEPARATOR); } catch (NodeException ne) { FolderNotFoundException fnfe = new FolderNotFoundException("Root folder not found"); fnfe.initCause(ne); throw fnfe; } catch (NodeNotFoundException nnfe) { FolderNotFoundException fnfe = new FolderNotFoundException("Root folder not found"); fnfe.initCause(nnfe); throw fnfe; } }
public Folder getFolder(Folder folder, String name) throws FolderNotFoundException, DocumentException { // perform lookup by path so that cache can be used String folderPath = folder.getPath() + Folder.PATH_SEPARATOR + name; try { return getFolder(folderPath); } catch (FolderNotFoundException fnfe) { throw fnfe; } catch (Exception e) { throw new FolderNotFoundException("Folder " + folderPath + " not found.", e); } }
FolderNotFoundException fnfe = new FolderNotFoundException("Root folder not found"); fnfe.initCause(ne); throw fnfe; FolderNotFoundException fnfe = new FolderNotFoundException("Root folder not found"); fnfe.initCause(nnfe); throw fnfe;
/** * <p> * getDynamicPage * </p> * * @see org.apache.jetspeed.page.PageManager#getDynamicPage(java.lang.String) * @param path * @return dynamic page * @throws PageNotFoundException * @throws NodeException * @throws FolderNotFoundException */ public DynamicPage getDynamicPage(String path) throws PageNotFoundException, NodeException { // get dynamic page via folder, (access checked in Folder.getDynamicPage()) try { FolderImpl folder = getNodeFolder(path); return folder.getDynamicPage(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new PageNotFoundException(fnfe.getMessage()); } }
/** * getFolder - proxy implementation of Folder.getFolder() * * @param proxy this folder proxy * @param name sub-folder name * @return sub-folder * @throws FolderNotFoundException * @throws DocumentException */ public Folder getFolder(Object proxy, String name) throws FolderNotFoundException, DocumentException { // search for folder by name or absolute path from // aggregated folders NodeSet allFolders = getFolders(proxy); if (allFolders != null) { Folder folder = (Folder)allFolders.get(name); if (folder != null) { return folder; } } throw new FolderNotFoundException("Folder " + name + " not found at " + getPath()); }
/** * <p> * getPage * </p> * * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String) * @param path * @return page * @throws PageNotFoundException * @throws NodeException * @throws FolderNotFoundException */ public Page getPage(String path) throws PageNotFoundException, NodeException { // get page via folder, (access checked in Folder.getPage()) try { FolderImpl folder = getNodeFolder(path); return folder.getPage(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new PageNotFoundException(fnfe.getMessage()); } }
if (!parent.exists()) throw new FolderNotFoundException("No folder exists at the path: " + parent.getAbsolutePath());
/** * <p> * getPageTemplate * </p> * * @see org.apache.jetspeed.page.PageManager#getPageTemplate(java.lang.String) * @param path * @return page template * @throws PageNotFoundException * @throws NodeException * @throws FolderNotFoundException */ public PageTemplate getPageTemplate(String path) throws PageNotFoundException, NodeException { // get page template via folder, (access checked in Folder.getPageTemplate()) try { FolderImpl folder = getNodeFolder(path); return folder.getPageTemplate(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new PageNotFoundException(fnfe.getMessage()); } }
if(!folderFile.exists()) throw new FolderNotFoundException(folderFile.getAbsolutePath()+" does not exist.");
/** * <p> * getFragmentDefinition * </p> * * @see org.apache.jetspeed.page.PageManager#getFragmentDefinition(java.lang.String) * @param path * @return dynamic page * @throws PageNotFoundException * @throws NodeException * @throws FolderNotFoundException */ public FragmentDefinition getFragmentDefinition(String path) throws PageNotFoundException, NodeException { // get fragment definition via folder, (access checked in Folder.getDynamicPage()) try { FolderImpl folder = getNodeFolder(path); return folder.getFragmentDefinition(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new PageNotFoundException(fnfe.getMessage()); } }
throw new FolderNotFoundException("Inheritance folders at " + getPath() + " not found or accessible");
/** * <p> * getLink * </p> * * @see org.apache.jetspeed.page.PageManager#getLink(java.lang.String) * @param path * @return link * @throws DocumentNotFoundException * @throws UnsupportedDocumentTypeException * @throws NodeException */ public Link getLink(String path) throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException { // get link via folder, (access checked in Folder.getLink()) try { FolderImpl folder = getNodeFolder(path); return folder.getLink(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new DocumentNotFoundException(fnfe.getMessage()); } }
/** * <p> * getFolder * </p> * * @param name * @param checkAccess flag * @return folder * @throws FolderNotFoundException * @throws DocumentException */ public Folder getFolder(String name, boolean checkAccess) throws FolderNotFoundException, DocumentException { // get folder Folder folder = (Folder) getAllNodes().subset(FOLDER_TYPE).get(name); if (folder == null) { throw new FolderNotFoundException("Jetspeed PSML folder not found: " + name); } // check access if (checkAccess) { folder.checkAccess(JetspeedActions.VIEW); } return folder; }
throw new NodeException(fnfe.getMessage());
public Folder getFolder(String name) throws FolderNotFoundException, DocumentException { // get folder instance if folders collection not available if (!foldersCached) { // use PageManager to get folder instance without // caching the folders collection for this folder return getPageManager().getFolder(this, name); } // select folder by name from cached folders collection Folder folder = (Folder)getFoldersNodeSet().get(name); if (folder == null) { throw new FolderNotFoundException("Folder not found: " + name); } // check for view access on folder folder.checkAccess(JetspeedActions.VIEW); return folder; }
public void removePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToDeleteDocumentException { // check for edit access pageSecurity.checkAccess(JetspeedActions.EDIT); try { FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR); // remove page security handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).removeDocument(pageSecurity); // update folder ((NodeSetImpl)folder.getAllNodes()).remove(pageSecurity); // notify page manager listeners notifyRemovedNode(pageSecurity); } catch (FolderNotFoundException fnfe) { throw new NodeException(fnfe.getMessage()); } catch (DocumentNotFoundException dnfe) { throw new NodeException(dnfe.getMessage()); } }
throw new FolderNotFoundException("Folder " + folderPath + " not found."); throw new FolderNotFoundException("Folder " + folderPath + " not found.", e);
throw new NodeException(fnfe.getMessage());