Package io.milton.http.http11
Class OptionsHandler
java.lang.Object
io.milton.http.http11.OptionsHandler
- All Implemented Interfaces:
Handler,ResourceHandler
Support the OPTIONS http method.
Note that windows 7 appears to require un-authenticated access to OPTIONS
requests, so this handler now supports configurable selection of allowing
un-authenticated access.
- Author:
- brad
-
Constructor Summary
ConstructorsConstructorDescriptionOptionsHandler(Http11ResponseHandler responseHandler, ResourceHandlerHelper resourceHandlerHelper, HandlerHelper handlerHelper, boolean enableAuthorisation) Creates an OptionHandler with no authorization -
Method Summary
Modifier and TypeMethodDescriptionString[]booleanisCompatible(Resource handler) booleanvoidprocess(HttpManager manager, Request request, Response response) voidprocessResource(HttpManager manager, Request request, Response response, Resource resource) voidsetEnableAuthorisation(boolean enableAuthorisation)
-
Constructor Details
-
OptionsHandler
public OptionsHandler(Http11ResponseHandler responseHandler, ResourceHandlerHelper resourceHandlerHelper, HandlerHelper handlerHelper, boolean enableAuthorisation) Creates an OptionHandler with no authorization- Parameters:
responseHandler-resourceHandlerHelper-handlerHelper-enableAuthorisation-
-
-
Method Details
-
process
public void process(HttpManager manager, Request request, Response response) throws NotAuthorizedException, ConflictException, BadRequestException - Specified by:
processin interfaceHandler- Throws:
NotAuthorizedExceptionConflictExceptionBadRequestException
-
processResource
public void processResource(HttpManager manager, Request request, Response response, Resource resource) throws NotAuthorizedException, ConflictException, BadRequestException - Specified by:
processResourcein interfaceResourceHandler- Throws:
NotAuthorizedExceptionConflictExceptionBadRequestException
-
getMethods
- Specified by:
getMethodsin interfaceHandler- Returns:
- - the http methods supported by this handler. Must be all upper case.
-
isCompatible
- Specified by:
isCompatiblein interfaceHandler- Returns:
- - true if the given resource is compatible with this method
-
isEnableAuthorisation
public boolean isEnableAuthorisation() -
setEnableAuthorisation
public void setEnableAuthorisation(boolean enableAuthorisation)
-