@Override public Resource getResource(String path) throws IOException { for(ResourceManager d : delegates) { Resource res = d.getResource(path); if(res != null) { return res; } } return null; }
@Override public Resource getResource(HttpServerExchange exchange, String path) throws IOException { return resourceManager.getResource(path); } }
@Override public Resource getResource(String path) throws IOException { for (ResourceManager resourceManager : this.resourceManagers) { Resource resource = resourceManager.getResource(path); if (resource != null) { return resource; } } return null; }
@Override public Resource getResource(String path) throws IOException { if (path.startsWith("/org/springframework/boot")) { return null; } return this.delegate.getResource(path); }
@Override public Resource getResource(HttpServerExchange exchange, String path) throws IOException { Resource originalResource = resourceManager.getResource(path); if(exchange.getRequestHeaders().contains(Headers.RANGE)) { //we don't use serve pre compressed resources for range requests return originalResource; } Resource resource = getEncodedResource(exchange, path, originalResource); if(resource == null) { return originalResource; } return resource; }
if(time > nextCheck) { marker.setNextCheckTime(time + maxAge); if(underlyingResourceManager.getResource(path) != null) { cache.remove(path); } else { final Resource underlying = underlyingResourceManager.getResource(path); if (underlying == null) { cache.add(path, new NoResourceMarker(maxAge > 0 ? System.currentTimeMillis() + maxAge : -1));
if(extension != null) { String newPath = path + extension; Resource resource = resourceManager.getResource(newPath); if(resource != null && !resource.isDirectory()) { return new Resource() {
res = manager.getResource(path); if(res != null) { return res;
@Override public Resource getResource(HttpServerExchange exchange, String path) throws IOException { return resourceManager.getResource(path); } }
public Resource getResource(String path) throws IOException { for (ResourceManager manager : managers) { Resource resource = manager.getResource(path); if (resource != null) return resource; } return null; }
@Override public Resource getResource(String path) throws IOException { for (ResourceManager resourceManager : this.resourceManagers) { Resource resource = resourceManager.getResource(path); if (resource != null) { return resource; } } return null; }
@Override public Resource getResource(HttpServerExchange exchange, String path) throws IOException { return resourceManager.getResource(path); } }
@Override public Resource getResource(String path) throws IOException { for(ResourceManager d : delegates) { Resource res = d.getResource(path); if(res != null) { return res; } } return null; }
@Override public Resource getResource(String path) throws IOException { for(ResourceManager d : delegates) { Resource res = d.getResource(path); if(res != null) { return res; } } return null; }
@Override public Resource getResource(String path) throws IOException { Resource resource = null; Iterator<ResourceManager> resourceManagerIterator = resourceManagers.iterator(); while (resource == null && resourceManagerIterator.hasNext()) { resource = resourceManagerIterator.next().getResource(path); } return resource; }
@Override public Resource getResource(HttpServerExchange exchange, String path) throws IOException { Resource originalResource = resourceManager.getResource(path); if(exchange.getRequestHeaders().contains(Headers.RANGE)) { //we don't use serve pre compressed resources for range requests return originalResource; } Resource resource = getEncodedResource(exchange, path, originalResource); if(resource == null) { return originalResource; } return resource; }
public void testGetResource() throws IOException { UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer = new JsfUndertowDeploymentInfoCustomizer(this.undertowProperties); DeploymentInfo deploymentInfo = new DeploymentInfo(); undertowDeploymentInfoCustomizer.customize(deploymentInfo); assertThat(deploymentInfo.getResourceManager().getResource("test.txt")) .isNotNull(); }
public void customize() throws MalformedURLException, IOException { UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(); this.undertowSpringBootAutoConfiguration.customize(factory); UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer = factory.getDeploymentInfoCustomizers().iterator().next(); DeploymentInfo deploymentInfo = new DeploymentInfo(); undertowDeploymentInfoCustomizer.customize(deploymentInfo); assertThat(deploymentInfo.getResourceManager().getResource("test.txt")) .isNotNull(); }
@Test public void customize() throws MalformedURLException, IOException { UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(); this.undertowSpringBootAutoConfiguration.customize(factory); UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer = factory.getDeploymentInfoCustomizers().iterator().next(); DeploymentInfo deploymentInfo = new DeploymentInfo(); undertowDeploymentInfoCustomizer.customize(deploymentInfo); assertThat(deploymentInfo.getResourceManager().getResource("testUndertow.txt")) .isNotNull(); }
@Test public void testGetResource() throws IOException { UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer = new JsfUndertowDeploymentInfoCustomizer(this.undertowProperties); DeploymentInfo deploymentInfo = new DeploymentInfo(); undertowDeploymentInfoCustomizer.customize(deploymentInfo); assertThat(deploymentInfo.getResourceManager().getResource("testUndertow.txt")) .isNotNull(); }