Package com.helger.http.basicauth
Class BasicAuthClientCredentials
java.lang.Object
com.helger.http.basicauth.BasicAuthClientCredentials
Credentials for HTTP basic authentication
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionBasicAuthClientCredentials(String sUserName) Create credentials with a user name only and no password.BasicAuthClientCredentials(String sUserName, String sPassword) Create credentials with a user name and a password. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreate the request HTTP header value for use with theCHttpHeader.AUTHORIZATIONheader name.inthashCode()booleantoString()
-
Constructor Details
-
BasicAuthClientCredentials
Create credentials with a user name only and no password.- Parameters:
sUserName- The user name to use. May neither benullnor empty.
-
BasicAuthClientCredentials
Create credentials with a user name and a password.- Parameters:
sUserName- The user name to use. May neither benullnor empty.sPassword- The password to use. May benullor empty to indicate that no password is present.
-
-
Method Details
-
getUserName
- Returns:
- The user name. Neither
nullnor empty.
-
getPassword
- Returns:
- The password. May be
nullor empty.
-
hasPassword
public boolean hasPassword()- Returns:
trueif a non-nullnon-empty password is present.
-
getRequestValue
Create the request HTTP header value for use with theCHttpHeader.AUTHORIZATIONheader name.- Returns:
- The HTTP header value to use. Neither
nullnor empty.
-
equals
-
hashCode
public int hashCode() -
toString
-