src/org/ohmage/validator/UserValidators.java
public static String validateHashedPassword(final String password) 
			throws ValidationException {
		
		LOGGER.info("Validating that the hashed password follows our conventions.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(password)) {
			return null;
		}
		
		if(HASHED_PASSWORD_PATTERN.matcher(password).matches()) {
			return password;
		}
		else {
			throw new ValidationException(
					ErrorCode.USER_INVALID_PASSWORD, 
					"The hashed password is invalid.");
		}
	}
/**
	 * Validates that a given hashed password follows our conventions. If it is
	 * null or whitespace only, null is returned. If it doesn't follow our
	 * conventions, a ValidationException is thrown. Otherwise, the password is
	 * passed back to the caller.
	 * 
	 * @param password The hashed password to validate.
	 * 
	 * @return Returns null if the password is null or whitespace only. 
	 * 		   Otherwise, it returns the password.
	 * 
	 * @throws ValidationException Thrown if the password isn't null or 
	 * 							   whitespace only and doesn't follow our 
	 * 							   conventions.
	 */
Validates that a given hashed password follows our conventions. If it is
null or whitespace only, null is returned. If it doesn't follow our
conventions, a ValidationException is thrown. Otherwise, the password is
passed back to the caller.

@param password The hashed password to validate.

@return Returns null if the password is null or whitespace only.
Otherwise, it returns the password.

@throws ValidationException Thrown if the password isn't null or
whitespace only and doesn't follow our
conventions.
Validates that a given hashed password follows our conventions . If it is null or whitespace only null is returned . If it doesn ' t follow our conventions a ValidationException is thrown . Otherwise the password is passed back to the caller . @param password The hashed password to validate . @return Returns null if the password is null or whitespace only . Otherwise it returns the password . @throws ValidationException Thrown if the password isn ' t null or whitespace only and doesn ' t follow our conventions .
public static String validateHashedPassword(final String password) 
			throws ValidationException {
		LOGGER.info("Validating that the hashed password follows our conventions.");
		if(StringUtils.isEmptyOrWhitespaceOnly(password)) {
			return null;
		}
		if(HASHED_PASSWORD_PATTERN.matcher(password).matches()) {
			return password;
		}
		else {
			throw new ValidationException(
					ErrorCode.USER_INVALID_PASSWORD, 
					"The hashed password is invalid.");
		}
	}
public static String validateHashedPassword ( final String password ) throws ValidationException { LOGGER . info ( "Validating that the hashed password follows our conventions." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( password ) ) { return null ; } if ( HASHED_PASSWORD_PATTERN . matcher ( password ) . matches ( ) ) { return password ; } else { throw new ValidationException ( ErrorCode . USER_INVALID_PASSWORD , "The hashed password is invalid." ) ; } }
Validates that a given hashed password follows our conventions.
Validates that a given hashed password follows our conventions .