Class UnknownCommandResolver

  • All Implemented Interfaces:
    URIResolver, URIResolverHandler

    public class UnknownCommandResolver
    extends CommandResolver
    Wrapper for an URIResolver, which gives failures on specific specific URLs, and forwards all others to the wrapped handler. This allows you to reserve a specific host for commands and get a well-defined error if giving an undefined command.
    • Constructor Detail

      • UnknownCommandResolver

        public UnknownCommandResolver​(URIResolver ur)
        Make a new UnknownCommandResolver, which gives an error for any command- like URL and forwards other URLs to the given URIResolver.
        Parameters:
        ur - The URIResolver to handle all other uris.
        Throws:
        ArgumentNotValid - if either argument is null.
    • Method Detail

      • executeCommand

        protected boolean executeCommand​(Request request,
                                         Response response)
        Helper method that checks if this is a command URL and throw an error if it is.
        Specified by:
        executeCommand in class CommandResolver
        Parameters:
        request - The request to check
        response - The response to give command results to if it is a command
        Returns:
        Whether this was a command URL