@Override public Resource addPath(String path) throws IOException, MalformedURLException { if (path.startsWith("/org/springframework/boot")) { return null; } return this.delegate.addPath(path); }
public void init(WebAppContext webAppContext) throws IOException { String railsRootDirName = webAppContext.getInitParameter("rails.root").replaceAll("/WEB-INF/", ""); String assetsDir = webAppContext.getWebInf().addPath(String.format("%s/public/assets/", railsRootDirName)).getName(); handler.setAssetsDir(assetsDir); }
public Resource getWebInf() throws IOException { if (super.getBaseResource() == null) return null; // Iw there a WEB-INF directory? Resource web_inf= super.getBaseResource().addPath("WEB-INF/"); if (!web_inf.exists() || !web_inf.isDirectory()) return null; return web_inf; }
/** * Get <code>WEB-INF/classes</code> dir * * @param context the context to look for the <code>WEB-INF/classes</code> directory * @return the Resource for the <code>WEB-INF/classes</code> directory * @throws Exception if unable to find the <code>WEB-INF/classes</code> directory */ protected Resource findWebInfClassesDir (WebAppContext context) throws Exception { if (context == null) return null; Resource web_inf = context.getWebInf(); // Find WEB-INF/classes if (web_inf != null && web_inf.isDirectory()) { // Look for classes directory Resource classes= web_inf.addPath("classes/"); if (classes.exists()) return classes; } return null; }
Resource fn=lib.addPath(files[f]); if(LOG.isDebugEnabled()) LOG.debug("addJar - {}", fn);
Resource web_inf= web_app.addPath("WEB-INF/"); IO.delete(extractedWebInfDir); extractedWebInfDir.mkdir(); Resource web_inf_lib = web_inf.addPath("lib/"); File webInfDir=new File(extractedWebInfDir,"WEB-INF"); webInfDir.mkdir(); Resource web_inf_classes = web_inf.addPath("classes/"); if (web_inf_classes.exists())
resourcesDir = target.addPath("/META-INF/resources");
protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException { String descriptor = context.getDescriptor(); if (descriptor != null) { Resource web = context.newResource(descriptor); if (web.exists() && !web.isDirectory()) return web; } Resource web_inf = context.getWebInf(); if (web_inf != null && web_inf.isDirectory()) { // do web.xml file Resource web = web_inf.addPath("web.xml"); if (web.exists()) return web; if (LOG.isDebugEnabled()) LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only"); } return null; }
/** Get a resource from within this resource. * <p> * This method is essentially an alias for {@link #addPath(String)}, but without checked exceptions. * This method satisfied the {@link ResourceFactory} interface. * @see org.eclipse.jetty.util.resource.ResourceFactory#getResource(java.lang.String) */ @Override public Resource getResource(String path) { try { return addPath(path); } catch(Exception e) { LOG.debug(e); return null; } }
public Collection<Resource> getAllResources() { try { ArrayList<Resource> deep=new ArrayList<>(); { String[] list=list(); if (list!=null) { for (String i:list) { Resource r=addPath(i); if (r.isDirectory()) deep.addAll(r.getAllResources()); else deep.add(r); } } } return deep; } catch(Exception e) { throw new IllegalStateException(e); } }
for (int i=0 ; i< ls.length ; i++) Resource item = addPath(ls[i]);
item = res.addPath(ls[i]); } catch (IOException ioe) { System.out.println("Skipping file in directory listing: " + ioe.getMessage());
@Override public Object findTemplateSource(String name) throws IOException { Resource resource = baseResource.addPath(name); if (!resource.exists()) { return null; } return resource; }
public Resource getWebInf() throws IOException { if (super.getBaseResource() == null) return null; // Iw there a WEB-INF directory? Resource web_inf= super.getBaseResource().addPath("WEB-INF/"); if (!web_inf.exists() || !web_inf.isDirectory()) return null; return web_inf; }