public class LocationCredentials
extends java.lang.Object
Constructor and Description |
---|
LocationCredentials(java.lang.String userId,
java.lang.String password)
Initialize the new instance with a userId and corresponding passwords.
|
LocationCredentials(java.lang.String realm,
java.lang.String userId,
java.lang.String password)
Initialize the new instance with a userId and corresponding passwords.
|
Modifier and Type | Method and Description |
---|---|
void |
addPattern(java.lang.String pattern)
Adds the given pattern to the URL patterns that can be accessed with this
object's authentication credentials.
|
void |
addPattern(StringPattern pattern)
Adds the given pattern to the URL patterns that can be accessed with this
object's authentication credentials.
|
boolean |
appliesTo(java.lang.String realm,
java.lang.String url)
Returns true if the given realm and URL match the settings in this object.
|
boolean |
appliesToRealm(java.lang.String realm)
Returns true if the given realm matches the realm name of this object.
|
boolean |
appliesToURL(java.lang.String url)
Returns true if the given URL matches any of the underlying patterns.
|
protected void |
fillCredentials()
Subclasses must override this method in order to get the credentials from
somewhere and set a PasswordAuthentication object using setCredentials().
|
protected java.net.PasswordAuthentication |
getCredentials() |
protected StringPatternCollection |
getLocationPatterns() |
java.net.PasswordAuthentication |
getPasswordAuthentication()
Returns the password based authentication data.
|
java.lang.String |
getRealm()
Returns the realm this credentials apply to
|
protected java.lang.String |
getRealmName() |
protected java.lang.String |
getUserId() |
protected void |
setCredentials(java.net.PasswordAuthentication newValue) |
protected void |
setLocationPatterns(StringPatternCollection newValue) |
void |
setRealm(java.lang.String realm)
Sets the realm this credentials apply to
|
protected void |
setRealmName(java.lang.String newValue) |
protected void |
setUserId(java.lang.String newValue) |
protected StringUtil |
str() |
public LocationCredentials(java.lang.String userId, java.lang.String password)
userId
- The userId to be used for authenticationpassword
- The password to be used for authenticationpublic LocationCredentials(java.lang.String realm, java.lang.String userId, java.lang.String password)
realm
- The realm that is accessible with the given credentialsuserId
- The userId to be used for authenticationpassword
- The password to be used for authenticationpublic java.net.PasswordAuthentication getPasswordAuthentication()
public java.lang.String getRealm()
public void setRealm(java.lang.String realm)
public void addPattern(java.lang.String pattern)
pattern
- A URL pattern that might contain '*' as wildcards.public void addPattern(StringPattern pattern)
pattern
- A URL pattern that might contain '*' as wildcards.public boolean appliesTo(java.lang.String realm, java.lang.String url)
public boolean appliesToURL(java.lang.String url)
public boolean appliesToRealm(java.lang.String realm)
protected void fillCredentials()
protected java.lang.String getRealmName()
protected void setRealmName(java.lang.String newValue)
protected StringPatternCollection getLocationPatterns()
protected void setLocationPatterns(StringPatternCollection newValue)
protected java.lang.String getUserId()
protected void setUserId(java.lang.String newValue)
protected java.net.PasswordAuthentication getCredentials()
protected void setCredentials(java.net.PasswordAuthentication newValue)
protected StringUtil str()