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

    Constructors
    Constructor
    Description
    ClassPathResourceManager(IWebServerConfiguration webServerConfiguration, ClassLoader classLoader, String prefix)
    Constructor for ClassPathResourceManager
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.undertow.server.handlers.resource.Resource
    Get the index file
    io.undertow.server.handlers.resource.Resource
     
    protected io.undertow.server.handlers.resource.Resource
    handleDirectory(String path, io.undertow.server.handlers.resource.Resource resource)
    Handle directory resource proper
    void
    setWelcomeFiles(String[] welcomeFiles)
    Set the welcome files

    Methods inherited from class io.undertow.server.handlers.resource.ClassPathResourceManager

    close, isResourceChangeListenerSupported, registerResourceChangeListener, removeResourceChangeListener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClassPathResourceManager

      public ClassPathResourceManager(IWebServerConfiguration webServerConfiguration, ClassLoader classLoader, String prefix)
      Constructor for ClassPathResourceManager
      Parameters:
      webServerConfiguration - the web server configuration
      classLoader - the class loader
      prefix - the prefix
  • Method Details

    • setWelcomeFiles

      public void setWelcomeFiles(String[] welcomeFiles)
      Set the welcome files
      Parameters:
      welcomeFiles - the welcome files
    • getResource

      public io.undertow.server.handlers.resource.Resource getResource(String path) throws IOException
      Specified by:
      getResource in interface io.undertow.server.handlers.resource.ResourceManager
      Overrides:
      getResource in class io.undertow.server.handlers.resource.ClassPathResourceManager
      Throws:
      IOException
      See Also:
      • ClassPathResourceManager.getResource(java.lang.String)
    • 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 path
      resource - 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