Commit 32cf4cad authored by Greg Messner's avatar Greg Messner
Browse files

More Javadoc fixes.

parent 1fa86252
......@@ -229,7 +229,7 @@ public abstract class AbstractApi {
* @param response response
* @param expected expected respone status
* @return original response if the response status is expected
* @throws GitLabApiException in case of unexpected response status
* @throws GitLabApiException if HTTP status is not as expected
*/
protected Response validate(Response response, Response.Status expected) throws GitLabApiException {
if (response.getStatus() != expected.getStatusCode()) {
......@@ -242,9 +242,8 @@ public abstract class AbstractApi {
/**
* Wraps exception if needed
*
* @param thrown exception
* @return never returns
* @throws GitLabApiException always
* @param thrown the exception that should be wrapped
* @throws GitLabApiException containing the cause or GitLab API specific message
*/
protected GitLabApiException handle(Exception thrown) throws GitLabApiException {
......
......@@ -22,8 +22,8 @@ public class CommitsApi extends AbstractApi {
* GET /projects/:id/repository/commits
*
* @param projectId the project ID to get the list of commits for
* @return a List<Commit> containing the commits for the specified project ID
* @throws GitLabApiException
* @return a list containing the commits for the specified project ID
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public List<Commit> getCommits(int projectId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "repository", "commits");
......@@ -39,7 +39,7 @@ public class CommitsApi extends AbstractApi {
* @param projectId the project ID that the commit belongs to
* @param sha a commit hash or name of a branch or tag
* @return the Commit instance for the specified project ID/sha pair
* @throws GitLabApiException
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public Commit getCommits(int projectId, String sha) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "repository", "commits", sha);
......@@ -54,7 +54,7 @@ public class CommitsApi extends AbstractApi {
* @param projectId the project ID that the commit belongs to
* @param sha a commit hash or name of a branch or tag
* @return the Diff instance for the specified project ID/sha pair
* @throws GitLabApiException
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public Diff getDiff(int projectId, String sha) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "repository", "commits", sha, "diff");
......
......@@ -24,6 +24,7 @@ public class GitLabApi {
* @param username user name for which private token should be obtained
* @param password password for a given {@code username}
* @return new {@code GitLabApi} instance configured for a user-specific token
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
static public GitLabApi create(String url, String username, String password) throws GitLabApiException {
String token = new SessionApi(new GitLabApi(url, null)).login(username, null, password).getPrivateToken();
......@@ -34,8 +35,8 @@ public class GitLabApi {
* Constructs a GitLabApi instance set up to interact with the GitLab server
* specified by hostUrl.
*
* @param hostUrl
* @param privateToken
* @param hostUrl the URL of the GitLab server
* @param privateToken to private token to use for access to the API
*/
public GitLabApi(String hostUrl, String privateToken) {
apiClient = new GitLabApiClient(hostUrl, privateToken);
......
......@@ -73,11 +73,9 @@ public class GitLabApiClient {
/**
* Sets up the Jersey system ignore SSL certificate errors or not.
*
* <p>
* <strong>WARNING: Setting this to true will affect ALL uses of HttpsURLConnection and Jersey.<strong>
* <p>
* WARNING: Setting this to true will affect ALL uses of HttpsURLConnection and Jersey.
*
* @param ignoreCertificateErrors
* @param ignoreCertificateErrors if true will set up the Jersey system ignore SSL certificate errors
*/
public void setIgnoreCerificateErrors(boolean ignoreCertificateErrors) {
......@@ -143,7 +141,7 @@ public class GitLabApiClient {
/**
* Construct a REST URL with the specified path arguments.
*
* @param pathArgs
* @param pathArgs ariable list of arguments used to build the URI
* @return a REST URL with the specified path arguments
* @throws IOException
*/
......@@ -165,8 +163,8 @@ public class GitLabApiClient {
* Perform an HTTP GET call with the specified query parameters and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param pathArgs
* @param queryParams multivalue map of request parameters
* @param pathArgs variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @throws IOException
*/
......@@ -179,8 +177,8 @@ public class GitLabApiClient {
* Perform an HTTP GET call with the specified query parameters and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param url
* @param queryParams multivalue map of request parameters
* @param url the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
protected Response get(MultivaluedMap<String, String> queryParams, URL url) {
......@@ -191,8 +189,8 @@ public class GitLabApiClient {
* Perform an HTTP POST call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param formData
* @param pathArgs
* @param formData the Form containing the name/value pairs
* @param pathArgs variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @throws IOException
*/
......@@ -205,9 +203,9 @@ public class GitLabApiClient {
* Perform an HTTP POST call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param formData
* @param pathArgs
* @return a ClientResponse instance with the data returned from the endpoint
* @param queryParams multivalue map of request parameters
* @param pathArgs variable list of arguments used to build the URI
* @return a Response instance with the data returned from the endpoint
* @throws IOException
*/
protected Response post(MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOException {
......@@ -219,8 +217,8 @@ public class GitLabApiClient {
* Perform an HTTP POST call with the specified form data and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param formData
* @param url
* @param formData the Form containing the name/value pairs
* @param url the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
protected Response post(Form formData, URL url) {
......@@ -230,9 +228,9 @@ public class GitLabApiClient {
/**
* Perform an HTTP POST call with the specified form data and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param formData
* @param url
*
* @param queryParams multivalue map of request parametersformData the Form containing the name/value pairs
* @param url the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
protected Response post(MultivaluedMap<String, String> queryParams, URL url) {
......@@ -243,8 +241,8 @@ public class GitLabApiClient {
* Perform an HTTP PUT call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param pathArgs
* @param queryParams multivalue map of request parameters
* @param pathArgs variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @throws IOException
*/
......@@ -256,9 +254,9 @@ public class GitLabApiClient {
/**
* Perform an HTTP PUT call with the specified form data and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param url
*
* @param queryParams multivalue map of request parameters
* @param url the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
protected Response put(MultivaluedMap<String, String> queryParams, URL url) {
......@@ -269,8 +267,8 @@ public class GitLabApiClient {
* Perform an HTTP DELETE call with the specified form data and path objects, returning
* a Response instance with the data returned from the endpoint.
*
* @param queryParams
* @param pathArgs
* @param queryParams multivalue map of request parameters
* @param pathArgs variable list of arguments used to build the URI
* @return a Response instance with the data returned from the endpoint
* @throws IOException
*/
......@@ -282,8 +280,8 @@ public class GitLabApiClient {
* Perform an HTTP DELETE call with the specified form data and URL, returning
* a Response instance with the data returned from the endpoint.
*
* @param queryParams
* @param url
* @param queryParams multivalue map of request parameters
* @param url the fully formed path to the GitLab API endpoint
* @return a Response instance with the data returned from the endpoint
*/
protected Response delete(MultivaluedMap<String, String> queryParams, URL url) {
......
......@@ -6,14 +6,15 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.junit.BeforeClass;
import org.junit.Test;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.messners.gitlab.api.models.Branch;
import com.messners.gitlab.api.models.Diff;
import com.messners.gitlab.api.models.Event;
......
......@@ -5,13 +5,13 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStreamReader;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.junit.BeforeClass;
import org.junit.Test;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.messners.gitlab.api.webhook.EventObject;
import com.messners.gitlab.api.webhook.PushEvent;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment