org.glassfish.jersey.client.filter
Class HttpBasicAuthFilter

java.lang.Object
  extended by org.glassfish.jersey.client.filter.HttpBasicAuthFilter
All Implemented Interfaces:
javax.ws.rs.client.ClientRequestFilter

public final class HttpBasicAuthFilter
extends Object
implements javax.ws.rs.client.ClientRequestFilter

Client filter adding HTTP Basic Authentication header to the HTTP request, if no such header is already present.

Author:
Jakub Podlesak (jakub.podlesak at oracle.com), Craig McClanahan

Constructor Summary
HttpBasicAuthFilter(String username, byte[] password)
          Creates a new HTTP Basic Authentication filter using provided username and password credentials.
HttpBasicAuthFilter(String username, String password)
          Creates a new HTTP Basic Authentication filter using provided username and password credentials.
 
Method Summary
 void filter(javax.ws.rs.client.ClientRequestContext rc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpBasicAuthFilter

public HttpBasicAuthFilter(String username,
                           String password)
Creates a new HTTP Basic Authentication filter using provided username and password credentials.

Parameters:
username - user name
password - password

HttpBasicAuthFilter

public HttpBasicAuthFilter(String username,
                           byte[] password)
Creates a new HTTP Basic Authentication filter using provided username and password credentials. This constructor allows you to avoid storing plain password value in a String variable.

Parameters:
username - user name
password - password
Method Detail

filter

public void filter(javax.ws.rs.client.ClientRequestContext rc)
            throws IOException
Specified by:
filter in interface javax.ws.rs.client.ClientRequestFilter
Throws:
IOException


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.