Methods Summary |
---|
public boolean | authenticate(java.lang.String password)returns true if the specified password is the password for this
user profile
StringEncrypter encrypter;
try {
encrypter = new StringEncrypter(StringEncrypter.DES_ENCRYPTION_SCHEME);
return encrypter.decrypt(encryptedPassword).equals(password);
} catch (EncryptionException e) {
throw new AzureusCoreException("Unable to decrypt password", e);
}
|
public boolean | equals(java.lang.Object obj)check for equality with another user profile object
if( obj == null || ! (obj instanceof UserProfile) )
return false;
UserProfile other = (UserProfile)obj;
if( getUsername() != null )
return getUsername().equals(other.getUsername());
else
if( other.getUsername() != null )
return false;
if( getEncryptedPassword() != null )
return getEncryptedPassword().equals(other.getEncryptedPassword());
else
if( other.getEncryptedPassword() != null )
return false;
return true;
|
public java.lang.String | getDefaultSaveDirectory()
return defaultSaveDirectory;
|
public java.lang.String | getEncryptedPassword()
return encryptedPassword;
|
public java.lang.String | getUserType()
return userType;
|
public java.lang.String | getUsername()
return username;
|
public static boolean | isValidUserType(java.lang.String userType)returns true if the specified value is a valid user type
return ADMIN.equals(userType) || USER.equals(userType) || GUEST.equals(userType);
|
public void | setDefaultSaveDirectory(java.lang.String newValue)
this.defaultSaveDirectory = newValue;
|
public void | setEncryptedPassword(java.lang.String encryptedPassword)
this.encryptedPassword = encryptedPassword;
|
public void | setPassword(java.lang.String password)stores the specified password as an encrypted password
try {
StringEncrypter encrypter = new StringEncrypter(StringEncrypter.DES_ENCRYPTION_SCHEME);
setEncryptedPassword(encrypter.encrypt(password));
} catch (EncryptionException e)
{
throw new AzureusCoreException("Unable to encrypt password", e);
}
|
public void | setUserType(java.lang.String userType)
this.userType = userType;
|
public void | setUsername(java.lang.String username)
this.username = username;
|