src/org/ohmage/service/UploadValidationServices.java
public static void validateIso8601Timestamp(final String timestamp, 
			final String errorMessageEmptyOrNull, 
			final String errorMessageInvalid) throws ServiceException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(timestamp)) {
			throw new ServiceException(
					ErrorCode.SERVER_INVALID_TIMESTAMP, 
					errorMessageEmptyOrNull);
		}
		
		SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_TIMESTAMP_PATTERN);
		sdf.setLenient(false);
		
		try {
			
			sdf.parse(timestamp);
			
		} catch (ParseException pe) {
			
			String msg = errorMessageInvalid + timestamp;
			throw new ServiceException(
					ErrorCode.SERVER_INVALID_TIMESTAMP, 
					msg, 
					pe);
		}
	}
/**
	 * Validates the provided timestamp. The timestamp must be of the form 
	 * yyyy-MM-dd HH:mm:ss in SimpleDateFormat pattern parlance. 
	 * 
	 * @param date The date to validate.
	 * @param errorMessageEmptyOrNull The error message to push into the
	 * Request when validation fails because the timestamp is null or empty.
	 * @param errorMessageInvalid The error message to push into the Request when
	 * validation fails because the timestamp is malformed.
	 * 
	 * @see java.util.SimpleDateFormat
	 * @throws ServiceException if the timestamp is null or an unparseable ISO8601 timestamp
	 */
Validates the provided timestamp. The timestamp must be of the form
yyyy-MM-dd HH:mm:ss in SimpleDateFormat pattern parlance.

@param date The date to validate.
@param errorMessageEmptyOrNull The error message to push into the
Request when validation fails because the timestamp is null or empty.
@param errorMessageInvalid The error message to push into the Request when
validation fails because the timestamp is malformed.

@see java.util.SimpleDateFormat
@throws ServiceException if the timestamp is null or an unparseable ISO8601 timestamp
Validates the provided timestamp . The timestamp must be of the form yyyy - MM - dd HH : mm : ss in SimpleDateFormat pattern parlance . @param date The date to validate . @param errorMessageEmptyOrNull The error message to push into the Request when validation fails because the timestamp is null or empty . @param errorMessageInvalid The error message to push into the Request when validation fails because the timestamp is malformed . @see java . util . SimpleDateFormat @throws ServiceException if the timestamp is null or an unparseable ISO8601 timestamp
public static void validateIso8601Timestamp(final String timestamp, 
			final String errorMessageEmptyOrNull, 
			final String errorMessageInvalid) throws ServiceException {
		if(StringUtils.isEmptyOrWhitespaceOnly(timestamp)) {
			throw new ServiceException(
					ErrorCode.SERVER_INVALID_TIMESTAMP, 
					errorMessageEmptyOrNull);
		}
		SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_TIMESTAMP_PATTERN);
		sdf.setLenient(false);
		try {
			sdf.parse(timestamp);
		} catch (ParseException pe) {
			String msg = errorMessageInvalid + timestamp;
			throw new ServiceException(
					ErrorCode.SERVER_INVALID_TIMESTAMP, 
					msg, 
					pe);
		}
	}
public static void validateIso8601Timestamp ( final String timestamp , final String errorMessageEmptyOrNull , final String errorMessageInvalid ) throws ServiceException { if ( StringUtils . isEmptyOrWhitespaceOnly ( timestamp ) ) { throw new ServiceException ( ErrorCode . SERVER_INVALID_TIMESTAMP , errorMessageEmptyOrNull ) ; } SimpleDateFormat sdf = new SimpleDateFormat ( ISO_8601_TIMESTAMP_PATTERN ) ; sdf . setLenient ( false ) ; try { sdf . parse ( timestamp ) ; } catch ( ParseException pe ) { String msg = errorMessageInvalid + timestamp ; throw new ServiceException ( ErrorCode . SERVER_INVALID_TIMESTAMP , msg , pe ) ; } }
Validates the provided timestamp.
Validates the provided timestamp .