@Override protected WebResourceSet createMainResourceSet() { return new LoaderHidingWebResourceSet(super.createMainResourceSet()); }
@Override public WebResource getResource(String path) { if (path.startsWith("/org/springframework/boot")) { return new EmptyResource(getRoot(), path); } return this.delegate.getResource(path); }
@Override protected WebResourceSet createMainResourceSet() { final Path docBase = config.docBase(); assert docBase.isAbsolute(); final String docBaseStr = docBase.toString(); getContext().setDocBase(docBaseStr); if (Files.isDirectory(docBase)) { return new DirResourceSet(this, "/", docBaseStr, "/"); } final Optional<String> jarRootOpt = config.jarRoot(); if (jarRootOpt.isPresent()) { // If docBase is a JAR file final String jarRoot = jarRootOpt.get(); if ("/".equals(jarRoot)) { return new JarResourceSet(this, "/", docBaseStr, "/"); } else { return new JarSubsetResourceSet(this, "/", docBaseStr, "/", jarRoot); } } throw new IllegalArgumentException(sm.getString("standardRoot.startInvalidMain", docBaseStr)); } }
@Override public void createWebResourceSet(ResourceSetType type, String webAppMount, URL url, String internalPath) { BaseLocation baseLocation = new BaseLocation(url); createWebResourceSet(type, webAppMount, baseLocation.getBasePath(), baseLocation.getArchivePath(), internalPath); }
private WebResource[] getResources(String path, boolean useClassLoaderResources) { path = validate(path); if (isCachingAllowed()) { return cache.getResources(path, useClassLoaderResources); } else { return getResourcesInternal(path, useClassLoaderResources); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarWarResource(getRoot(), webAppPath, getBase(), getBaseUrlString(), jarEntry, archivePath, getInternalPath(), manifest); }
private WebResource getResource(String path, boolean validate, boolean useClassLoaderResources) { if (validate) { path = validate(path); } if (isCachingAllowed()) { return cache.getResource(path, useClassLoaderResources); } else { return getResourceInternal(path, useClassLoaderResources); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarResource(getRoot(), webAppPath, getBase(), getBaseUrlString(), jarEntry, getInternalPath(), manifest); }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarResource(this, webAppPath, getBaseUrlString(), jarEntry); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarWarResource(this, webAppPath, getBaseUrlString(), jarEntry, archivePath); }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new WarResource(this, webAppPath, getBaseUrlString(), jarEntry); } }
@Override public void backgroundProcess() { cache.backgroundProcess(); gc(); }
"org.apache.catalina.webresources.TomcatURLStreamHandlerFactory", getClass().getClassLoader())) { TomcatURLStreamHandlerFactory.register();
protected void configureSslStoreProvider(AbstractHttp11JsseProtocol<?> protocol, SslStoreProvider sslStoreProvider) { Assert.isInstanceOf(Http11NioProtocol.class, protocol, "SslStoreProvider can only be used with Http11NioProtocol"); TomcatURLStreamHandlerFactory instance = TomcatURLStreamHandlerFactory .getInstance(); instance.addUserFactory( new SslStoreProviderUrlStreamHandlerFactory(sslStoreProvider)); try { if (sslStoreProvider.getKeyStore() != null) { protocol.setKeystorePass(""); protocol.setKeystoreFile( SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); } if (sslStoreProvider.getTrustStore() != null) { protocol.setTruststorePass(""); protocol.setTruststoreFile( SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); } } catch (Exception ex) { throw new WebServerException("Could not load store: " + ex.getMessage(), ex); } }
@Override public void createWebResourceSet(ResourceSetType type, String webAppMount, URL url, String internalPath) { BaseLocation baseLocation = new BaseLocation(url); createWebResourceSet(type, webAppMount, baseLocation.getBasePath(), baseLocation.getArchivePath(), internalPath); }
private WebResource[] getResources(String path, boolean useClassLoaderResources) { path = validate(path); if (isCachingAllowed()) { return cache.getResources(path, useClassLoaderResources); } else { return getResourcesInternal(path, useClassLoaderResources); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarResource(this, webAppPath, getBaseUrlString(), jarEntry); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarWarResource(this, webAppPath, getBaseUrlString(), jarEntry, archivePath); }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new WarResource(this, webAppPath, getBaseUrlString(), jarEntry); } }
@Override public void createWebResourceSet(ResourceSetType type, String webAppMount, URL url, String internalPath) { BaseLocation baseLocation = new BaseLocation(url); createWebResourceSet(type, webAppMount, baseLocation.getBasePath(), baseLocation.getArchivePath(), internalPath); }