Package org.apache.http.impl.client
Class BasicCredentialsProvider
java.lang.Object
org.apache.http.impl.client.BasicCredentialsProvider
- All Implemented Interfaces:
CredentialsProvider
public class BasicCredentialsProvider extends Object implements CredentialsProvider
Default implementation of
CredentialsProvider- Since:
- 4.0
- Author:
- Remy Maucherat, Rodney Waldhoff, Jeff Dever, Sean C. Sullivan, Michael Becke, Oleg Kalnichevski, Mike Bowler, Adrian Sutton
-
Constructor Summary
Constructors Constructor Description BasicCredentialsProvider()Default constructor. -
Method Summary
Modifier and Type Method Description voidclear()Clears all credentials.CredentialsgetCredentials(AuthScope authscope)Get thecredentialsfor the given authentication scope.voidsetCredentials(AuthScope authscope, Credentials credentials)Sets thecredentialsfor the given authentication scope.StringtoString()Returns a string containing a concise, human-readable description of this object.
-
Constructor Details
-
BasicCredentialsProvider
public BasicCredentialsProvider()Default constructor.
-
-
Method Details
-
setCredentials
Sets thecredentialsfor the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentialsin interfaceCredentialsProvider- Parameters:
authscope- theauthentication scopecredentials- the authenticationcredentialsfor the given scope.- See Also:
getCredentials(AuthScope)
-
getCredentials
Get thecredentialsfor the given authentication scope.- Specified by:
getCredentialsin interfaceCredentialsProvider- Parameters:
authscope- theauthentication scope- Returns:
- the credentials
- See Also:
setCredentials(AuthScope, Credentials)
-
toString
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod. -
clear
public void clear()Clears all credentials.- Specified by:
clearin interfaceCredentialsProvider
-