Package rs.jerseyclient.util
Class CookieAuthorizationFilter
java.lang.Object
rs.jerseyclient.util.CookieAuthorizationFilter
- All Implemented Interfaces:
javax.ws.rs.client.ClientRequestFilter,javax.ws.rs.client.ClientResponseFilter
public class CookieAuthorizationFilter
extends Object
implements javax.ws.rs.client.ClientRequestFilter, javax.ws.rs.client.ClientResponseFilter
Handles cookies and "Accept" header in requests and responses.
- Author:
- ralph
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(javax.ws.rs.client.ClientRequestContext requestContext) Sets cookies if required in the request.voidfilter(javax.ws.rs.client.ClientRequestContext requestContext, javax.ws.rs.client.ClientResponseContext responseContext) Filters the reponse and evaluate the cookies to be set.Returns the acceptable media types to signal to the sever.voidsetAcceptableMediaTypes(String acceptableMediaTypes) Sets the acceptable media types to signal to the sever.
-
Field Details
-
DEFAULT_ACCEPT_HEADER
Default Accept header value- See Also:
-
-
Constructor Details
-
CookieAuthorizationFilter
public CookieAuthorizationFilter()Default Constructor.
-
-
Method Details
-
getAcceptableMediaTypes
Returns the acceptable media types to signal to the sever. Default isDEFAULT_ACCEPT_HEADER.- Returns:
- the acceptable mediatypes
-
setAcceptableMediaTypes
Sets the acceptable media types to signal to the sever. Default isDEFAULT_ACCEPT_HEADER.- Parameters:
acceptableMediaTypes- the acceptable media types to set
-
filter
public void filter(javax.ws.rs.client.ClientRequestContext requestContext, javax.ws.rs.client.ClientResponseContext responseContext) throws IOException Filters the reponse and evaluate the cookies to be set.- Specified by:
filterin interfacejavax.ws.rs.client.ClientResponseFilter- Throws:
IOException
-
filter
Sets cookies if required in the request.- Specified by:
filterin interfacejavax.ws.rs.client.ClientRequestFilter- Throws:
IOException
-