src/org/ohmage/jee/filter/ClientFilter.java
private final String retrieveClient(
			final Map<String, String[]> parameters)
			throws InvalidClientException {
		
		// Get the list of clients.
		String[] clients = parameters.get(InputKeys.CLIENT);
		
		// If there were no client parameters, return null.
		if(clients == null) {
			return null;
		}
		
		// If there are multiple clients, throw an error.
		if(clients.length > 1) {
			throw
				new InvalidClientException(
					"More than one client value was given.");
		}
		else if(clients.length == 1) {
			// Get the client.
			return validateClient(clients[0]);
		}
		
		// If there was no client value, return null.
		return null;
	}
/**
	 * Validates the client value from the parameters.
	 * 
	 * @param parameters The parameters already decoded from the HTTP request.
	 * 
	 * @return The client value.
	 * 
	 * @throws InvalidClientException Multiple client values were given or the
	 * 								  one given client value was invalid.
	 */
Validates the client value from the parameters.

@param parameters The parameters already decoded from the HTTP request.

@return The client value.

@throws InvalidClientException Multiple client values were given or the
one given client value was invalid.
Validates the client value from the parameters . @param parameters The parameters already decoded from the HTTP request . @return The client value . @throws InvalidClientException Multiple client values were given or the one given client value was invalid .
private final String retrieveClient(
			final Map<String, String[]> parameters)
			throws InvalidClientException {
		String[] clients = parameters.get(InputKeys.CLIENT);
		if(clients == null) {
			return null;
		}
		if(clients.length > 1) {
			throw
				new InvalidClientException(
					"More than one client value was given.");
		}
		else if(clients.length == 1) {
			return validateClient(clients[0]);
		}
		return null;
	}
private final String retrieveClient ( final Map < String , String [ ] > parameters ) throws InvalidClientException { String [ ] clients = parameters . get ( InputKeys . CLIENT ) ; if ( clients == null ) { return null ; } if ( clients . length > 1 ) { throw new InvalidClientException ( "More than one client value was given." ) ; } else if ( clients . length == 1 ) { return validateClient ( clients [ 0 ] ) ; } return null ; }
Validates the client value from the parameters.
Validates the client value from the parameters .
// Get the list of clients. // If there were no client parameters, return null. // If there are multiple clients, throw an error. // Get the client. // If there was no client value, return null.