src/org/ohmage/validator/AuditValidators.java
public static URI validateUri(final String uri) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(uri)) {
			return null;
		}
		
		try {
			return new URI(uri);
		}
		catch(URISyntaxException e) {
			throw new ValidationException(
					ErrorCode.AUDIT_INVALID_URI, 
					"The URI was invalid: " + uri, 
					e
				);
		}
	}
/**
	 * Validates that the URI string is a valid URI per Java's implementation 
	 * URI.<br />
	 * <br />
	 * Note: The definition of a URI is very liberal and great care should
	 * be taken when using the value that is returned.<br />
	 * <br />
	 * Note: An empty string is considered a valid URI, however our approach 
	 * for handling empty string across all validators is to return null for an
	 * empty string.
	 * 
	 * @param uri The URI as a string.
	 * 
	 * @return The URI as a Java URI object.
	 * 
	 * @throws ValidationException If the URI string cannot be converted into a
	 * 							   URI object.
	 */
Validates that the URI string is a valid URI per Java's implementation
URI.

Note: The definition of a URI is very liberal and great care should
be taken when using the value that is returned.

Note: An empty string is considered a valid URI, however our approach
for handling empty string across all validators is to return null for an
empty string.

@param uri The URI as a string.

@return The URI as a Java URI object.

@throws ValidationException If the URI string cannot be converted into a
URI object.
Validates that the URI string is a valid URI per Java ' s implementation URI . Note : The definition of a URI is very liberal and great care should be taken when using the value that is returned . Note : An empty string is considered a valid URI however our approach for handling empty string across all validators is to return null for an empty string . @param uri The URI as a string . @return The URI as a Java URI object . @throws ValidationException If the URI string cannot be converted into a URI object .
public static URI validateUri(final String uri) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(uri)) {
			return null;
		}
		try {
			return new URI(uri);
		}
		catch(URISyntaxException e) {
			throw new ValidationException(
					ErrorCode.AUDIT_INVALID_URI, 
					"The URI was invalid: " + uri, 
					e
				);
		}
	}
public static URI validateUri ( final String uri ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( uri ) ) { return null ; } try { return new URI ( uri ) ; } catch ( URISyntaxException e ) { throw new ValidationException ( ErrorCode . AUDIT_INVALID_URI , "The URI was invalid: " + uri , e ) ; } }
Validates that the URI string is a valid URI per Java's implementation
 URI.<br />
 <br />
 Note: The definition of a URI is very liberal and great care should
 be taken when using the value that is returned.<br />
 <br />
 Note: An empty string is considered a valid URI, however our approach
 for handling empty string across all validators is to return null for an
 empty string.
Validates that the URI string is a valid URI per Java ' s implementation URI . <br / > <br / > Note : The definition of a URI is very liberal and great care should be taken when using the value that is returned . <br / > <br / > Note : An empty string is considered a valid URI however our approach for handling empty string across all validators is to return null for an empty string .