private void registerStaticFiles(Bundle bundle) { PathNode pathNode = new BundlePathNode(bundle, "META-INF/static-web"); bundleNodeMap.put(bundle, pathNode); }
@Override public String[] list(PathNameFilter filter) { List<String> resultList = new ArrayList<String>(); String[] unfilterd = list(); for (String entry : unfilterd) { if (filter.accept(this, entry)) { resultList.add(entry); } } return resultList.toArray(new String[resultList.size()]); }
@Override public PathNode getSubPath(String requestPath) { StringWriter mergedPath = new StringWriter(255); mergedPath.append(path); if ((!path.isEmpty()) && (path.charAt(path.length() - 1) != '/')) { mergedPath.append('/'); } if (requestPath.charAt(0) == '/') { mergedPath.append(requestPath.substring(1)); } else { mergedPath.append(requestPath); } return new BundlePathNode(bundle, mergedPath.toString()); }
/** * Sets up a path in a bundle or file system to be exposed over a * <code>org.apache.clerezza.web.fileserver.FileServer</code>. The path is * relative to the locationof the class. * * @param context The bundle context of the bundle containing the path. * @param path the path where the file are to be exposed */ public void configure(BundleContext context, String path) { PathNode pathNode; Bundle bundle = context.getBundle(); URL resourceDir = getClass().getResource(path); pathNode = new BundlePathNode(bundle, resourceDir.getPath()); configure(pathNode); } /**