Package ej.restserver.endpoint
Class GzipResourceEndpoint
- java.lang.Object
-
- ej.restserver.RestEndpoint
-
- ej.restserver.endpoint.ResourceRestEndpoint
-
- ej.restserver.endpoint.GzipResourceEndpoint
-
public class GzipResourceEndpoint extends ResourceRestEndpoint
A static resource end-point to serve gzip files.
-
-
Field Summary
Fields Modifier and Type Field Description static StringGZIP_FILE_EXTENSIONGzip file extension.-
Fields inherited from class ej.restserver.endpoint.ResourceRestEndpoint
resource
-
Fields inherited from class ej.restserver.RestEndpoint
uri
-
-
Constructor Summary
Constructors Constructor Description GzipResourceEndpoint(String uri, String resource)Creates a static gzip resource end-point that responds to given URI and serves given resource.GzipResourceEndpoint(String uri, String resource, String mimetype)Creates a static gzip resource end-point that responds to given URI and serves given resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HTTPResponsegetResourceResponse()Gets the resource to serve as an HTTP response.-
Methods inherited from class ej.restserver.endpoint.ResourceRestEndpoint
get, getMimetype, getResourceAsStream, setMimetype
-
Methods inherited from class ej.restserver.RestEndpoint
delete, getURI, post, put
-
-
-
-
Field Detail
-
GZIP_FILE_EXTENSION
public static final String GZIP_FILE_EXTENSION
Gzip file extension.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GzipResourceEndpoint
public GzipResourceEndpoint(String uri, String resource)
Creates a static gzip resource end-point that responds to given URI and serves given resource.- Parameters:
uri- the end-point URI, cannot benull.resource- the GZip to serve, cannot benull.
-
GzipResourceEndpoint
public GzipResourceEndpoint(String uri, String resource, String mimetype)
Creates a static gzip resource end-point that responds to given URI and serves given resource.- Parameters:
uri- the end-point URI, cannot benull.resource- the GZip to serve, cannot benull.mimetype- the mime type of the resource, ifnull, the mimetype will be computed.- See Also:
MIMEUtils#getMIMEType(String)
-
-
Method Detail
-
getResourceResponse
protected HTTPResponse getResourceResponse()
Description copied from class:ResourceRestEndpointGets the resource to serve as an HTTP response. By default, it serves embedded resource withapplication/octet-streamcontent type.- Overrides:
getResourceResponsein classResourceRestEndpoint- Returns:
- the HTTP response corresponding to the resource to serve.
- See Also:
MIMEUtils#MIME_DEFAULT_BINARY
-
-