@Override @Deprecated public URL getURL() { return this.delegate.getURL(); }
String tmp = URIUtil.decodePath(resource.getURL().getPath()); if (tmp.endsWith("/")) tmp = tmp.substring(0, tmp.length()-1);
@Override public URL getURL() { if(_resources==null) throw new IllegalStateException("*resources* not set."); for(Resource r : _resources) { URL url = r.getURL(); if(url!=null) return url; } return null; }
/** * URI representing the resource. * * @return an URI representing the given resource */ public URI getURI() { try { return getURL().toURI(); } catch(Exception e) { throw new RuntimeException(e); } }
@Override public URL getURL() { if(_resources==null) throw new IllegalStateException("*resources* not set."); for(Resource r : _resources) { URL url = r.getURL(); if(url!=null) return url; } return null; }
public boolean check(String path, Resource resource) { if (resource.exists()) return false; String a=resource.getAlias().toString(); String r=resource.getURL().toString(); if (a.length()>r.length()) return a.startsWith(r) && a.length()==r.length()+1 && a.endsWith("/"); else return r.startsWith(a) && r.length()==a.length()+1 && r.endsWith("/"); } }
public boolean check(String path, Resource resource) { if (resource.exists()) return false; String a=resource.getAlias().toString(); String r=resource.getURL().toString(); if (a.length()>r.length()) return a.startsWith(r) && a.length()==r.length()+1 && a.endsWith("/"); else return r.startsWith(a) && r.length()==a.length()+1 && r.endsWith("/"); } }
public boolean check(String path, Resource resource) { if (resource.exists()) return false; String a=resource.getAlias().toString(); String r=resource.getURL().toString(); if (a.length()>r.length()) return a.startsWith(r) && a.length()==r.length()+1 && a.endsWith("/"); else return r.startsWith(a) && r.length()==a.length()+1 && r.endsWith("/"); } }
public boolean check(String path, Resource resource) { if (resource.exists()) return false; String a=resource.getAlias().toString(); String r=resource.getURL().toString(); if (a.length()>r.length()) return a.startsWith(r) && a.length()==r.length()+1 && a.endsWith("/"); else return r.startsWith(a) && r.length()==a.length()+1 && r.endsWith("/"); } }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
private void addStaticPath(ServletHolder holder, String basePath, String relativeMarkerPathToResource) throws URISyntaxException { String path = Resource.newClassPathResource(relativeMarkerPathToResource).getURL().toString(); final String fullBasePath = path.substring(0, path.length() - relativeMarkerPathToResource.length()) + basePath; holder.setInitParameter("dirAllowed", "false"); holder.setInitParameter("pathInfoOnly", "true"); holder.setInitParameter("resourceBase", fullBasePath); }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }
@Override public URL getResource(String path) throws MalformedURLException { Resource resource = ContextHandler.this.getResource(path); if (resource != null && resource.exists()) return resource.getURL(); return null; }