src/org/ohmage/validator/AuditValidators.java
public static String validateClient(final String client) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(client)) {
			return null;
		}
		
		if(client.trim().length() > MAX_CLIENT_LENGTH) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_CLIENT, 
					"The client value cannot be longer than " + 
						MAX_CLIENT_LENGTH + 
						" characters."
				);
		}
		else {
			return client.trim();
		}
	}
/**
	 * Checks if the client string is null or whitespace only. We put no other
	 * limitations on the client string because a user may want to query about
	 * client values that the server doesn't know about.
	 * 
	 * @param client The client string value.
	 * 
	 * @return The client string value unless it was null or whitespace only in
	 * 		   which case null is returned. 
	 * 
	 * @throws ValidationException Thrown if the client value is greater than
	 * 							   {@value #MAX_CLIENT_LENGTH} characters.
	 */
Checks if the client string is null or whitespace only. We put no other
limitations on the client string because a user may want to query about
client values that the server doesn't know about.

@param client The client string value.

@return The client string value unless it was null or whitespace only in
which case null is returned.

@throws ValidationException Thrown if the client value is greater than
#MAX_CLIENT_LENGTH characters.
Checks if the client string is null or whitespace only . We put no other limitations on the client string because a user may want to query about client values that the server doesn ' t know about . @param client The client string value . @return The client string value unless it was null or whitespace only in which case null is returned . @throws ValidationException Thrown if the client value is greater than #MAX_CLIENT_LENGTH characters .
public static String validateClient(final String client) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(client)) {
			return null;
		}
		if(client.trim().length() > MAX_CLIENT_LENGTH) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_CLIENT, 
					"The client value cannot be longer than " + 
						MAX_CLIENT_LENGTH + 
						" characters."
				);
		}
		else {
			return client.trim();
		}
	}
public static String validateClient ( final String client ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( client ) ) { return null ; } if ( client . trim ( ) . length ( ) > MAX_CLIENT_LENGTH ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_CLIENT , "The client value cannot be longer than " + MAX_CLIENT_LENGTH + " characters." ) ; } else { return client . trim ( ) ; } }
Checks if the client string is null or whitespace only.
Checks if the client string is null or whitespace only .