private Client getClient(final String user, final String password) throws AuthenticationException {
        if(user == null || password == null){
            LOG.error("You are currently using a method that requires credentials. Please use '-user' '-password'.");
            throw new AuthenticationException();
        }

        final Client client = getClient();
        client.addFilter(new HTTPBasicAuthFilter(user, password));

        return client;
    }
private Client getClient ( final String user , final String password ) throws AuthenticationException { if ( user == null || password == null ) { LOG . error ( "You are currently using a method that requires credentials. Please use '-user' '-password'." ) ; throw new AuthenticationException ( ) ; } final Client client = getClient ( ) ; client . addFilter ( new HTTPBasicAuthFilter ( user , password ) ) ; return client ; }
Provide Jersey client for the targeted Grapes server with authentication

@param user
@param password
@return
@throws javax.naming.AuthenticationException