Class GzipResourceEndpoint


  • public class GzipResourceEndpoint
    extends ResourceRestEndpoint
    A static resource end-point to serve gzip files.
    • 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 be null.
        resource - the GZip to serve, cannot be null.
      • 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 be null.
        resource - the GZip to serve, cannot be null.
        mimetype - the mime type of the resource, if null, the mimetype will be computed.
        See Also:
        MIMEUtils#getMIMEType(String)
    • Method Detail

      • getResourceResponse

        protected HTTPResponse getResourceResponse()
        Description copied from class: ResourceRestEndpoint
        Gets the resource to serve as an HTTP response. By default, it serves embedded resource with application/octet-stream content type.
        Overrides:
        getResourceResponse in class ResourceRestEndpoint
        Returns:
        the HTTP response corresponding to the resource to serve.
        See Also:
        MIMEUtils#MIME_DEFAULT_BINARY