src/org/ohmage/validator/ImageValidators.java
public static Image.Size validateImageSize(final String imageSize) 
			throws ValidationException {
		
		LOGGER.info("Validating an image size value.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(imageSize)) {
			return Image.ORIGINAL;
		}
		
		try {
			return Image.getSize(imageSize.trim());
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.IMAGE_INVALID_SIZE, 
					"The image size value is an unknown value: " + imageSize, 
					e);
		}
	}
/**
	 * Validates that an image size value is a valid image size value. If it is
	 * null or whitespace only, null is returned. Otherwise, an ImageSize is
	 * returned.
	 * 
	 * @param imageSize The image size to be validated.
	 * 
	 * @return Returns null if the image size is null or whitespace only;
	 * 		   otherwise, an ImageSize representing the image size is returned.
	 * 
	 * @throws ValidationException Thrown if the image size is not null, not
	 * 							   whitespace only, and not a valid ImageSize.
	 */
Validates that an image size value is a valid image size value. If it is
null or whitespace only, null is returned. Otherwise, an ImageSize is
returned.

@param imageSize The image size to be validated.

@return Returns null if the image size is null or whitespace only;
otherwise, an ImageSize representing the image size is returned.

@throws ValidationException Thrown if the image size is not null, not
whitespace only, and not a valid ImageSize.
Validates that an image size value is a valid image size value . If it is null or whitespace only null is returned . Otherwise an ImageSize is returned . @param imageSize The image size to be validated . @return Returns null if the image size is null or whitespace only ; otherwise an ImageSize representing the image size is returned . @throws ValidationException Thrown if the image size is not null not whitespace only and not a valid ImageSize .
public static Image.Size validateImageSize(final String imageSize) 
			throws ValidationException {
		LOGGER.info("Validating an image size value.");
		if(StringUtils.isEmptyOrWhitespaceOnly(imageSize)) {
			return Image.ORIGINAL;
		}
		try {
			return Image.getSize(imageSize.trim());
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.IMAGE_INVALID_SIZE, 
					"The image size value is an unknown value: " + imageSize, 
					e);
		}
	}
public static Image . Size validateImageSize ( final String imageSize ) throws ValidationException { LOGGER . info ( "Validating an image size value." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( imageSize ) ) { return Image . ORIGINAL ; } try { return Image . getSize ( imageSize . trim ( ) ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . IMAGE_INVALID_SIZE , "The image size value is an unknown value: " + imageSize , e ) ; } }
Validates that an image size value is a valid image size value.
Validates that an image size value is a valid image size value .