Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.messners.gitlab.api;
  
  import java.net.URL;
  
  import  javax.ws.rs.core.MultivaluedMap;
  
 import  com.sun.jersey.api.representation.Form;
 
 public abstract class AbstractApi {
 
 	private GitLabApi gitLabApi;
 	
 	public AbstractApi (GitLabApi gitLabApi) {
 		this. = gitLabApi;
 	}
 
 	protected GitLabApiClient getApiClient () {
 		return (.getApiClient());
 	}



Perform an HTTP GET call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
queryParams
pathArgs
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
IOException
 
 	protected  ClientResponse get (MultivaluedMap<StringStringqueryParamsObject ... pathArgs
 		return (getApiClient().get(queryParamspathArgs));	
 	}	


Perform an HTTP GET call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
queryParams
url
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
 
 	protected ClientResponse get (MultivaluedMap<StringStringqueryParamsURL url
 		return (getApiClient().get(queryParamsurl));	
 	}		


Perform an HTTP POST call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
formData
pathArgs
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
IOException
 
 	protected ClientResponse post (Form formDataObject ... pathArgs
 		return (getApiClient().post(formDatapathArgs));		
 	}


Perform an HTTP POST call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
formData
url
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
 
 	protected ClientResponse post (Form formDataURL urlthrows UniformInterfaceExceptionClientHandlerException {
 		return (getApiClient().post(formDataurl));		
 	}


Perform an HTTP DELETE call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
queryParams
pathArgs
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
IOException
	protected  ClientResponse delete (MultivaluedMap<StringStringqueryParamsObject ... pathArgs)
		return (getApiClient().delete(queryParamspathArgs));	
	}	


Perform an HTTP DELETE call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.

Parameters:
queryParams
url
Returns:
a ClientResponse instance with the data returned from the endpoint
Throws:
UniformInterfaceException
ClientHandlerException
	protected ClientResponse delete (MultivaluedMap<StringStringqueryParamsURL url
		return (getApiClient().delete(queryParamsurl));
	}


Parameters:
formData
string
email
required
	protected void addFormParam(Form formDataString nameObject valueboolean requiredthrows IllegalArgumentException {
			if (value == null) {
				if (required) {
					throw new IllegalArgumentException(name + " cannot be empty or null");
				}
				return;
			}
			String stringValue = value.toString().trim();
			if (required && stringValue.length() == 0) {
				throw new IllegalArgumentException(name + " cannot be empty or null");
			}
			formData.add(namestringValue);		
	}
New to GrepCode? Check out our FAQ X