Class ClassPathResourceManager
java.lang.Object
io.undertow.server.handlers.resource.ClassPathResourceManager
com.github.toolarium.jwebserver.handler.routing.resource.ClassPathResourceManager
- All Implemented Interfaces:
io.undertow.server.handlers.resource.ResourceManager,Closeable,AutoCloseable
public class ClassPathResourceManager
extends io.undertow.server.handlers.resource.ClassPathResourceManager
Classpath resource manager to handle resource with missing slash
-
Field Summary
Fields inherited from interface io.undertow.server.handlers.resource.ResourceManager
EMPTY_RESOURCE_MANAGER -
Constructor Summary
ConstructorsConstructorDescriptionClassPathResourceManager(IWebServerConfiguration webServerConfiguration, ClassLoader classLoader, String prefix) Constructor for ClassPathResourceManager -
Method Summary
Modifier and TypeMethodDescriptionprotected io.undertow.server.handlers.resource.ResourcegetIndexFiles(String base) Get the index fileio.undertow.server.handlers.resource.ResourcegetResource(String path) protected io.undertow.server.handlers.resource.ResourcehandleDirectory(String path, io.undertow.server.handlers.resource.Resource resource) Handle directory resource propervoidsetWelcomeFiles(String[] welcomeFiles) Set the welcome filesMethods inherited from class io.undertow.server.handlers.resource.ClassPathResourceManager
close, isResourceChangeListenerSupported, registerResourceChangeListener, removeResourceChangeListener
-
Constructor Details
-
ClassPathResourceManager
public ClassPathResourceManager(IWebServerConfiguration webServerConfiguration, ClassLoader classLoader, String prefix) Constructor for ClassPathResourceManager- Parameters:
webServerConfiguration- the web server configurationclassLoader- the class loaderprefix- the prefix
-
-
Method Details
-
setWelcomeFiles
Set the welcome files- Parameters:
welcomeFiles- the welcome files
-
getResource
- Specified by:
getResourcein interfaceio.undertow.server.handlers.resource.ResourceManager- Overrides:
getResourcein classio.undertow.server.handlers.resource.ClassPathResourceManager- Throws:
IOException- See Also:
-
handleDirectory
protected io.undertow.server.handlers.resource.Resource handleDirectory(String path, io.undertow.server.handlers.resource.Resource resource) throws IOException Handle directory resource proper- Parameters:
path- the pathresource- the recognized resource- Returns:
- the resource
- Throws:
IOException- In case of an I/O error
-
getIndexFiles
protected io.undertow.server.handlers.resource.Resource getIndexFiles(String base) throws IOException Get the index file- Parameters:
base- the base path- Returns:
- the resource
- Throws:
IOException- In case of an I/O error
-