public void addResource(String string, Resource childResource) { directoryMap.addResource(new ServerResourcePath(string), childResource); }
/** * Create next path of the path chain. * Path /foo/bar/baz should be converted to /bar/baz , /bar/baz -> /baz -> null * @return next subdirectory path or null. */ public ServerResourcePath getNextPath() { if (hasNextPath()) { return new ServerResourcePath(pathElements, pathIndex + 1); } else { return null; } }
@Override protected ServerResource getServerResource(String path) { return serverRoot.getResource(new ServerResourcePath(path)); }
/** * Create next path of the path chain. * Path /foo/bar/baz should be converted to /bar/baz , /bar/baz -> /baz -> null * @return next subdirectory path or null. */ public ServerResourcePath getNextPath() { if (hasNextPath()) { return new ServerResourcePath(pathElements, pathIndex + 1); } else { return null; } }
@Override protected void addDirectory(String directoryPath) { serverRoot.createChildDirectory(new ServerResourcePath(directoryPath)); } }
@Override protected void addDirectory(String directoryPath) { serverRoot.addDirectory(new ServerResourcePath(directoryPath)); }
@Override protected void addDirectory(String directoryPath) { serverRoot.addDirectory(new ServerResourcePath(directoryPath)); }
@Override protected ServerResource getServerResource(String path) { return serverRoot.getResource(new ServerResourcePath(path)); }
@Override public void addContent(String path, String content) { ServerResourcePath resourcePath = new ServerResourcePath(path); serverRoot.addResource(resourcePath, new StringContentServerResource(content)); }
@Override public Resource addPath(String path) throws IOException, MalformedURLException { Resource resource = directoryMap.getResource(new ServerResourcePath("/" + path)); if (resource == null) { resource = new BadResource(path); } return resource; }
@Override public void addResource(String path, URL resource) { serverRoot.addResource(new ServerResourcePath(path), new UrlServerResource(resource)); }
@Override public void addContent(String path, String content) { ServerResourcePath resourcePath = new ServerResourcePath(path); serverRoot.addResource(resourcePath, new StringContentServerResource(content)); }
@Override public void addResource(String path, String resource) { ServerResourcePath resourcePath = new ServerResourcePath(path); serverRoot.addResource(resourcePath, new ClasspathServerResource( resource)); }
@Override public void addResource(String path, String resource) { ServerResourcePath resourcePath = new ServerResourcePath(path); serverRoot.addResource(resourcePath, new ClasspathServerResource( resource)); }
@Override public void addResource(String path, URL resource) { serverRoot.addResource(new ServerResourcePath(path), new UrlServerResource(resource)); }