Package net.targetr.rc
Class RootResponder
java.lang.Object
net.targetr.rc.RootResponder
- All Implemented Interfaces:
ResponseGenerator
Responds to HTTP requests base on URI.
- Author:
- Dr Michael Gardiner
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(HttpRequest httpReq) Reads a request and returns a suitable response.getStaticResponse
(HttpRequest httpReq, String path, String contentType) getStaticZippedResponse
(HttpRequest httpReq, File zipFile, String path, String contentType)
-
Field Details
-
VERSION
- See Also:
-
-
Constructor Details
-
RootResponder
public RootResponder()
-
-
Method Details
-
generate
Description copied from interface:ResponseGenerator
Reads a request and returns a suitable response.- Specified by:
generate
in interfaceResponseGenerator
- Parameters:
httpReq
- The request to process to generate a response.- Returns:
- The response suitable for the request.
- Throws:
Exception
- When anything goes wrong generating the response.
-
getStaticResponse
public HttpResponse getStaticResponse(HttpRequest httpReq, String path, String contentType) throws IOException - Throws:
IOException
-
getStaticZippedResponse
public HttpResponse getStaticZippedResponse(HttpRequest httpReq, File zipFile, String path, String contentType) throws IOException - Throws:
IOException
-