Package org.apache.commons.httpclient
Class NTCredentials
- java.lang.Object
-
- org.apache.commons.httpclient.UsernamePasswordCredentials
-
- org.apache.commons.httpclient.NTCredentials
-
- All Implemented Interfaces:
Credentials
public class NTCredentials extends UsernamePasswordCredentials
Credentialsfor use with the NTLM authentication scheme which requires additional information.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description NTCredentials()Deprecated.Do not use.NTCredentials(java.lang.String userName, java.lang.String password, java.lang.String host, java.lang.String domain)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Performs a case-sensitive check to see if the components of the credentials are the same.java.lang.StringgetDomain()Retrieves the name to authenticate with.java.lang.StringgetHost()Retrieves the host name of the computer originating the request.inthashCode()Computes a hash code based on all the case-sensitive parts of the credentials object.voidsetDomain(java.lang.String domain)Deprecated.Do not use.voidsetHost(java.lang.String host)Deprecated.Do not use.java.lang.StringtoString()Return a string representation of this object.-
Methods inherited from class org.apache.commons.httpclient.UsernamePasswordCredentials
getPassword, getUserName, setPassword, setUserName
-
-
-
-
Constructor Detail
-
NTCredentials
public NTCredentials()
Deprecated.Do not use. Null user name, domain & host no longer allowedDefault constructor.
-
NTCredentials
public NTCredentials(java.lang.String userName, java.lang.String password, java.lang.String host, java.lang.String domain)Constructor.- Parameters:
userName- The user name. This should not include the domain to authenticate with. For example: "user" is correct whereas "DOMAIN\\user" is not.password- The password.host- The host the authentication request is originating from. Essentially, the computer name for this machine.domain- The domain to authenticate within.
-
-
Method Detail
-
setDomain
public void setDomain(java.lang.String domain)
Deprecated.Do not use. The NTCredentials objects should be immutableSets the domain to authenticate with. The domain may not be null.- Parameters:
domain- the NT domain to authenticate in.- See Also:
getDomain()
-
getDomain
public java.lang.String getDomain()
Retrieves the name to authenticate with.- Returns:
- String the domain these credentials are intended to authenticate with.
- See Also:
setDomain(String)
-
setHost
public void setHost(java.lang.String host)
Deprecated.Do not use. The NTCredentials objects should be immutableSets the host name of the computer originating the request. The host name may not be null.- Parameters:
host- the Host the user is logged into.
-
getHost
public java.lang.String getHost()
Retrieves the host name of the computer originating the request.- Returns:
- String the host the user is logged into.
-
toString
public java.lang.String toString()
Return a string representation of this object.- Overrides:
toStringin classUsernamePasswordCredentials- Returns:
- A string represenation of this object.
-
hashCode
public int hashCode()
Computes a hash code based on all the case-sensitive parts of the credentials object.- Overrides:
hashCodein classUsernamePasswordCredentials- Returns:
- The hash code for the credentials.
-
equals
public boolean equals(java.lang.Object o)
Performs a case-sensitive check to see if the components of the credentials are the same.- Overrides:
equalsin classUsernamePasswordCredentials- Parameters:
o- The object to match.- Returns:
trueif all of the credentials match.
-
-