src/org/ohmage/validator/ImageValidators.java
public static UUID validateId(final String imageId) 
			throws ValidationException {
		
		LOGGER.info("Validating an image ID.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(imageId)) {
			return null;
		}
		
		try {
			return UUID.fromString(imageId);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.IMAGE_INVALID_ID, 
					"The image ID is not a valid image ID: " + imageId);
		}
	}
/**
	 * Validates that an image ID is a valid image ID. If it is null or 
	 * whitespace only, null is returned. Otherwise, the image is returned or
	 * an exception is thrown.
	 * 
	 * @param imageId The image's ID.
	 * 
	 * @return Returns null if the image ID is null or whitespace only; 
	 * 		   otherwise, the image ID is returned.
	 * 
	 * @throws ValidationException Thrown if the image ID is not null, not
	 * 							   whitespace only, and not a valid image ID.
	 */
Validates that an image ID is a valid image ID. If it is null or
whitespace only, null is returned. Otherwise, the image is returned or
an exception is thrown.

@param imageId The image's ID.

@return Returns null if the image ID is null or whitespace only;
otherwise, the image ID is returned.

@throws ValidationException Thrown if the image ID is not null, not
whitespace only, and not a valid image ID.
Validates that an image ID is a valid image ID . If it is null or whitespace only null is returned . Otherwise the image is returned or an exception is thrown . @param imageId The image ' s ID . @return Returns null if the image ID is null or whitespace only ; otherwise the image ID is returned . @throws ValidationException Thrown if the image ID is not null not whitespace only and not a valid image ID .
public static UUID validateId(final String imageId) 
			throws ValidationException {
		LOGGER.info("Validating an image ID.");
		if(StringUtils.isEmptyOrWhitespaceOnly(imageId)) {
			return null;
		}
		try {
			return UUID.fromString(imageId);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.IMAGE_INVALID_ID, 
					"The image ID is not a valid image ID: " + imageId);
		}
	}
public static UUID validateId ( final String imageId ) throws ValidationException { LOGGER . info ( "Validating an image ID." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( imageId ) ) { return null ; } try { return UUID . fromString ( imageId ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . IMAGE_INVALID_ID , "The image ID is not a valid image ID: " + imageId ) ; } }
Validates that an image ID is a valid image ID.
Validates that an image ID is a valid image ID .