src/org/ohmage/validator/DocumentValidators.java
public static String validateDocumentId(final String documentId) 
			throws ValidationException {
		
		LOGGER.info("Validating a document's ID.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(documentId)) {
			return null;
		}
		
		if(StringUtils.isValidUuid(documentId.trim())) {
			return documentId.trim();
		}
		else {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_ID, 
					"The document ID is invalid: " + documentId);
		}
	}
/**
	 * Validates a document's unique identifier.
	 * 
	 * @param documentId The document ID in question.
	 * 
	 * @return Returns the document's ID if it is valid. Returns null if it is
	 * 		   null or whitespace only.
	 * 
	 * @throws ValidationException Thrown if the document's ID is not null, not
	 * 							   whitespace only, and not a valid document 
	 * 							   ID.
	 */
Validates a document's unique identifier.

@param documentId The document ID in question.

@return Returns the document's ID if it is valid. Returns null if it is
null or whitespace only.

@throws ValidationException Thrown if the document's ID is not null, not
whitespace only, and not a valid document
ID.
Validates a document ' s unique identifier . @param documentId The document ID in question . @return Returns the document ' s ID if it is valid . Returns null if it is null or whitespace only . @throws ValidationException Thrown if the document ' s ID is not null not whitespace only and not a valid document ID .
public static String validateDocumentId(final String documentId) 
			throws ValidationException {
		LOGGER.info("Validating a document's ID.");
		if(StringUtils.isEmptyOrWhitespaceOnly(documentId)) {
			return null;
		}
		if(StringUtils.isValidUuid(documentId.trim())) {
			return documentId.trim();
		}
		else {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_ID, 
					"The document ID is invalid: " + documentId);
		}
	}
public static String validateDocumentId ( final String documentId ) throws ValidationException { LOGGER . info ( "Validating a document's ID." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( documentId ) ) { return null ; } if ( StringUtils . isValidUuid ( documentId . trim ( ) ) ) { return documentId . trim ( ) ; } else { throw new ValidationException ( ErrorCode . DOCUMENT_INVALID_ID , "The document ID is invalid: " + documentId ) ; } }
Validates a document's unique identifier.
Validates a document ' s unique identifier .