Class InternalFileResourceController

java.lang.Object
com.chillycheesy.modulo.controllers.InternalFileResourceController
All Implemented Interfaces:
Controller

public class InternalFileResourceController extends Object implements Controller
Controller for serving internal files. It takes the request path and tries to find the file in a target module jar. The target jar location is defined by the result of the next controller. for a full compatibility with the additional path inside the server folder, you should to add the additional-path key inside the configuration. for more information about the additional-path key, see the HttpPathVariableController.
  • Constructor Details

    • InternalFileResourceController

      public InternalFileResourceController(JarFile jarFile)
      Constructor for the InternalFileResourceController.
      Parameters:
      jarFile - the jar file where the resource server is register.
  • Method Details

    • apply

      public Object apply(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Configuration configuration) throws Exception
      Apply the controller.
      Specified by:
      apply in interface Controller
      Parameters:
      request - the http request.
      response - the http response.
      configuration - the configuration.
      Returns:
      The content of the resource file or null if it was undefinable.
      Throws:
      Exception - If an error occurs.
    • setNextStep

      public void setNextStep(Controller controller)
      Set the next controller in the chain.
      Specified by:
      setNextStep in interface Controller
      Parameters:
      controller - The next controller.