/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * This implementation supports file paths beneath the root of the web application. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * This implementation supports file paths beneath the root of the web application. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
@Override public Resource createRelative(String relativePath) { String pathToUse = StringUtils.applyRelativePath(this.path, relativePath); return new PortletContextResource(this.portletContext, pathToUse); }
@Override public Resource createRelative(String relativePath) { String pathToUse = StringUtils.applyRelativePath(this.path, relativePath); return new PortletContextResource(this.portletContext, pathToUse); }
/** * Recursively retrieve PortletContextResources that match the given pattern, * adding them to the given result set. * @param portletContext the PortletContext to work on * @param fullPattern the pattern to match against, * with preprended root directory path * @param dir the current directory * @param result the Set of matching Resources to add to * @throws IOException if directory contents could not be retrieved * @see org.springframework.web.portlet.context.PortletContextResource * @see javax.portlet.PortletContext#getResourcePaths */ protected void doRetrieveMatchingPortletContextResources( PortletContext portletContext, String fullPattern, String dir, Set<Resource> result) throws IOException { Set<String> candidates = portletContext.getResourcePaths(dir); if (candidates != null) { boolean dirDepthNotFixed = fullPattern.contains("**"); for (Iterator<String> it = candidates.iterator(); it.hasNext();) { String currPath = it.next(); if (currPath.endsWith("/") && (dirDepthNotFixed || StringUtils.countOccurrencesOf(currPath, "/") <= StringUtils.countOccurrencesOf(fullPattern, "/"))) { doRetrieveMatchingPortletContextResources(portletContext, fullPattern, currPath, result); } if (getPathMatcher().match(fullPattern, currPath)) { result.add(new PortletContextResource(portletContext, currPath)); } } } }
/** * Recursively retrieve PortletContextResources that match the given pattern, * adding them to the given result set. * @param portletContext the PortletContext to work on * @param fullPattern the pattern to match against, * with preprended root directory path * @param dir the current directory * @param result the Set of matching Resources to add to * @throws IOException if directory contents could not be retrieved * @see org.springframework.web.portlet.context.PortletContextResource * @see javax.portlet.PortletContext#getResourcePaths */ protected void doRetrieveMatchingPortletContextResources( PortletContext portletContext, String fullPattern, String dir, Set<Resource> result) throws IOException { Set candidates = portletContext.getResourcePaths(dir); if (candidates != null) { boolean dirDepthNotFixed = fullPattern.contains("**"); for (Iterator it = candidates.iterator(); it.hasNext();) { String currPath = (String) it.next(); if (currPath.endsWith("/") && (dirDepthNotFixed || StringUtils.countOccurrencesOf(currPath, "/") <= StringUtils.countOccurrencesOf(fullPattern, "/"))) { doRetrieveMatchingPortletContextResources(portletContext, fullPattern, currPath, result); } if (getPathMatcher().match(fullPattern, currPath)) { result.add(new PortletContextResource(portletContext, currPath)); } } } }