public InputStream getResourceAsStream(String path) { ServerResource resource = getServerResource(path); if(null != resource){ try { return resource.getAsStream(); } catch (IOException e) { return null; } } return null; }
public URL getResource(String path) throws MalformedURLException { URL url = null; ServerResource resource = getServerResource(path); if(null != resource){ url = resource.getURL(); } return url; }
public InputStream getResourceAsStream(String path) { ServerResource resource = getServerResource(path); if(null != resource){ try { return resource.getAsStream(); } catch (IOException e) { return null; } } return null; }
public URL getResource(String path) throws MalformedURLException { URL url = null; ServerResource resource = getServerResource(path); if(null != resource){ url = resource.getURL(); } return url; }
@SuppressWarnings("unchecked") public Set getResourcePaths(String path) { HashSet result=null; ServerResource resource = getServerResource(path); if(null == resource && !path.endsWith("/")){ path+="/"; resource = getServerResource(path); } if(null != resource){ Set<String> paths = resource.getPaths(); if(null != paths && paths.size()>0){ result = new HashSet(paths.size()); for (String resourcePath : paths) { result.add(path+resourcePath); } } } return result; }
@SuppressWarnings("unchecked") public Set getResourcePaths(String path) { HashSet result=null; ServerResource resource = getServerResource(path); if(null == resource && !path.endsWith("/")){ path+="/"; resource = getServerResource(path); } if(null != resource){ Set<String> paths = resource.getPaths(); if(null != paths && paths.size()>0){ result = new HashSet(paths.size()); for (String resourcePath : paths) { result.add(path+resourcePath); } } } return result; }