Module aeonics.http
Package aeonics.http

Class Endpoint.File.Type

    • Constructor Detail

      • Type

        public Type()
    • Method Detail

      • matches

        public boolean matches​(java.lang.String url)
        Description copied from class: Endpoint.Type
        Returns true if the provided URL matches this endpoint
        Overrides:
        matches in class Endpoint.Type
        Parameters:
        url - the URL to compare
        Returns:
        true if the provided URL matches this endpoint
      • process

        public Data process​(Message request)
                     throws java.lang.Exception
        Description copied from class: Endpoint.Type
        Processes the request and generates a response.

        The generated response can be any of the following:

        • null: a 204 response is sent
        • an exception: it is the same as if you throw it
        • a scalar data type: it is sent as-is with an 'application/octet-stream' mime type and a code 200
        • a list or map data type: it is converted to its JSON representation and sent with an 'application/json' mime type and a code 200
        • a special response data map containing:
          • isHttpResponse [required]: true [required]
          • code: the http status code to send. Default 200.
          • status: the http status text. If not specified, it will be derived from the response code.
          • mime: the mime type to send. Default 'application/octet-stream'.
          • body: the content to send (if a data map or list, then its JSON representation is used). Default to "".
          • headers: any http response headers to send as a data map.
        Specified by:
        process in class Endpoint.Type
        Parameters:
        request - the original message data
        Returns:
        the generated response
        Throws:
        java.lang.Exception - if anything happens, the exception will be wrapped in an HttpException