src/org/ohmage/domain/AccessRequest.java
public static Collection<String> validateUserList(
			final String userListString) throws ValidationException {
		
		LOGGER.info("Validating the list of users.");
		
		// If the class list is an empty string, then we return null.
		if(StringUtils.isEmptyOrWhitespaceOnly(userListString)) {
			return null;
		}
				
		// Otherwise, attempt to parse and evaluate the list
	
		// Create the list of class IDs to be returned to the caller.
		Set<String> userList = new HashSet<String>();

		String[] requestListArray = userListString.split(InputKeys.LIST_ITEM_SEPARATOR);
		if (requestListArray.length > MAX_LIST_LENGTH) {
			throw new ValidationException(
					ErrorCode.USER_ACCESS_REQUEST_INVALID_PRAMETER, 
					"The list cannot exceed the maximum length of " + MAX_LIST_LENGTH);	
		}

		for (String user : requestListArray) {
			// Validate the current request ID.
			try {
				String currUser = UserValidators.validateUsername(user);
			
				// if it is null, then ignore since it is due to white space.
				if(currUser != null) {
					userList.add(currUser);
				} 
			} catch (ValidationException e) {
				throw new ValidationException(
						ErrorCode.USER_ACCESS_REQUEST_INVALID_PRAMETER, 
						"The lsit contains invalid username(s): " + user);
			}
		}
		
		return userList;
	}
/**
	 * Validates that all of user identifiers in the comma-separated list are valid 
	 * usernames. If the argument is null or whitespace only, it will 
	 * return null. If not, it will attempt to parse the string and evaluate each 
	 * of the element in the list. If any user name is invalid, it will return an error 
	 * message.
	 *  
	 * @param userListString The username list as a string where each item is
	 * 							separated by
	 * 						  	{@value org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR}.
	 * 
	 * @return Returns a list of usernames from the argument or null if the argument string 
	 *         is null, whitespace only, or would otherwise be empty.
	 * 
	 * @throws ValidationException Thrown if the request Id list string contains an
	 * 							 invalid UUID.
	 */
Validates that all of user identifiers in the comma-separated list are valid
usernames. If the argument is null or whitespace only, it will
return null. If not, it will attempt to parse the string and evaluate each
of the element in the list. If any user name is invalid, it will return an error
message.

@param userListString The username list as a string where each item is
separated by
org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR.

@return Returns a list of usernames from the argument or null if the argument string
is null, whitespace only, or would otherwise be empty.

@throws ValidationException Thrown if the request Id list string contains an
invalid UUID.
Validates that all of user identifiers in the comma - separated list are valid usernames . If the argument is null or whitespace only it will return null . If not it will attempt to parse the string and evaluate each of the element in the list . If any user name is invalid it will return an error message . @param userListString The username list as a string where each item is separated by org . ohmage . request . InputKeys#LIST_ITEM_SEPARATOR . @return Returns a list of usernames from the argument or null if the argument string is null whitespace only or would otherwise be empty . @throws ValidationException Thrown if the request Id list string contains an invalid UUID .
public static Collection<String> validateUserList(
			final String userListString) throws ValidationException {
		LOGGER.info("Validating the list of users.");
		if(StringUtils.isEmptyOrWhitespaceOnly(userListString)) {
			return null;
		}
		Set<String> userList = new HashSet<String>();
		String[] requestListArray = userListString.split(InputKeys.LIST_ITEM_SEPARATOR);
		if (requestListArray.length > MAX_LIST_LENGTH) {
			throw new ValidationException(
					ErrorCode.USER_ACCESS_REQUEST_INVALID_PRAMETER, 
					"The list cannot exceed the maximum length of " + MAX_LIST_LENGTH);	
		}
		for (String user : requestListArray) {
			try {
				String currUser = UserValidators.validateUsername(user);
				if(currUser != null) {
					userList.add(currUser);
				} 
			} catch (ValidationException e) {
				throw new ValidationException(
						ErrorCode.USER_ACCESS_REQUEST_INVALID_PRAMETER, 
						"The lsit contains invalid username(s): " + user);
			}
		}
		return userList;
	}
public static Collection < String > validateUserList ( final String userListString ) throws ValidationException { LOGGER . info ( "Validating the list of users." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( userListString ) ) { return null ; } Set < String > userList = new HashSet < String > ( ) ; String [ ] requestListArray = userListString . split ( InputKeys . LIST_ITEM_SEPARATOR ) ; if ( requestListArray . length > MAX_LIST_LENGTH ) { throw new ValidationException ( ErrorCode . USER_ACCESS_REQUEST_INVALID_PRAMETER , "The list cannot exceed the maximum length of " + MAX_LIST_LENGTH ) ; } for ( String user : requestListArray ) { try { String currUser = UserValidators . validateUsername ( user ) ; if ( currUser != null ) { userList . add ( currUser ) ; } } catch ( ValidationException e ) { throw new ValidationException ( ErrorCode . USER_ACCESS_REQUEST_INVALID_PRAMETER , "The lsit contains invalid username(s): " + user ) ; } } return userList ; }
Validates that all of user identifiers in the comma-separated list are valid
 usernames.
Validates that all of user identifiers in the comma - separated list are valid usernames .
// If the class list is an empty string, then we return null. // Otherwise, attempt to parse and evaluate the list // Create the list of class IDs to be returned to the caller. // Validate the current request ID. // if it is null, then ignore since it is due to white space.