Class ResourceHandler

  • All Implemented Interfaces:
    org.forgerock.http.Handler

    public class ResourceHandler
    extends Object
    implements org.forgerock.http.Handler
    A ResourceHandler is a handler that serves static content (content of a directory, or a zip).

    It's using the remaining URL information provided by the UriRouterContext to determine the resource path to look for.

    • Constructor Detail

      • ResourceHandler

        public ResourceHandler​(org.forgerock.util.Factory<org.forgerock.http.io.Buffer> storage,
                               List<ResourceSet> sets,
                               List<String> welcomePages)
        Creates a new ResourceHandler with the given sets of ResourceSet and the list of welcome pages mappings.
        Parameters:
        storage - the temporary storage to use to stream the resource
        sets - provide access to Resource.
        welcomePages - the list of resources name to be searched if there is no remaining path to use in the request.
    • Method Detail

      • handle

        public org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,​org.forgerock.util.promise.NeverThrowsException> handle​(org.forgerock.services.context.Context context,
                                                                                                                                                     org.forgerock.http.protocol.Request request)
        Specified by:
        handle in interface org.forgerock.http.Handler