Class InternalFileResourceController
java.lang.Object
com.chillycheesy.modulo.controllers.InternalFileResourceController
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionInternalFileResourceController(JarFile jarFile)Constructor for the InternalFileResourceController. -
Method Summary
Modifier and TypeMethodDescriptionapply(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Configuration configuration)Apply the controller.voidsetNextStep(Controller controller)Set the next controller in the chain.
-
Constructor Details
-
InternalFileResourceController
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 ExceptionApply the controller.- Specified by:
applyin interfaceController- 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
Set the next controller in the chain.- Specified by:
setNextStepin interfaceController- Parameters:
controller- The next controller.
-