/** * Given a string which might be a id or a (sitemap or VFS) URI, this method will return * a bean containing the right (sitemap or vfs) root path and (sitemap entry or structure) id.<p> * * @param cms the current CMS context * @param idOrUri a string containing an id or an URI * * @return a bean containing a root path and an id * * @throws CmsException if something goes wrong */ protected static CmsVfsFileValueBean getFileValueForIdOrUri(CmsObject cms, String idOrUri) throws CmsException { CmsVfsFileValueBean result; if (CmsUUID.isValidUUID(idOrUri)) { CmsUUID id = new CmsUUID(idOrUri); String uri = getUriForId(cms, id); result = new CmsVfsFileValueBean(cms.getRequestContext().addSiteRoot(uri), id); } else { String uri = idOrUri; CmsUUID id = getIdForUri(cms, idOrUri); result = new CmsVfsFileValueBean(cms.getRequestContext().addSiteRoot(uri), id); } return result; }