Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
c526865f
Commit
c526865f
authored
Jan 30, 2017
by
Greg Messner
Browse files
Fixed javadoc issues.
parent
8ba76549
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/AbstractApi.java
View file @
c526865f
...
@@ -8,9 +8,6 @@ import java.net.URL;
...
@@ -8,9 +8,6 @@ import java.net.URL;
/**
/**
* This class is the base class for all the sub API classes. It provides implementations of
* This class is the base class for all the sub API classes. It provides implementations of
* delete(), get(), post() and put() that are re-used by all the sub-classes.
* delete(), get(), post() and put() that are re-used by all the sub-classes.
*
* @author Greg Messner <greg@messners.com>
*
*/
*/
public
abstract
class
AbstractApi
{
public
abstract
class
AbstractApi
{
...
@@ -29,10 +26,10 @@ public abstract class AbstractApi {
...
@@ -29,10 +26,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param pathArgs
* @param pathArgs
variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
get
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
protected
Response
get
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -47,10 +44,10 @@ public abstract class AbstractApi {
...
@@ -47,10 +44,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param url
* @param url
the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
get
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
protected
Response
get
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -65,10 +62,10 @@ public abstract class AbstractApi {
...
@@ -65,10 +62,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param formData
* @param formData
the Form containing the name/value pairs for the POST data
* @param pathArgs
* @param pathArgs
variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
post
(
Response
.
Status
expectedStatus
,
Form
formData
,
Object
...
pathArgs
)
throws
GitLabApiException
{
protected
Response
post
(
Response
.
Status
expectedStatus
,
Form
formData
,
Object
...
pathArgs
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -83,10 +80,10 @@ public abstract class AbstractApi {
...
@@ -83,10 +80,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param pathArgs
* @param pathArgs
variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
post
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
protected
Response
post
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -101,10 +98,10 @@ public abstract class AbstractApi {
...
@@ -101,10 +98,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param formData
* @param formData
the Form containing the name/value pairs for the POST data
* @param url
* @param url
the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
post
(
Response
.
Status
expectedStatus
,
Form
formData
,
URL
url
)
throws
GitLabApiException
{
protected
Response
post
(
Response
.
Status
expectedStatus
,
Form
formData
,
URL
url
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -119,10 +116,10 @@ public abstract class AbstractApi {
...
@@ -119,10 +116,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param pathArgs
* @param pathArgs
variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
put
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
protected
Response
put
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -137,10 +134,10 @@ public abstract class AbstractApi {
...
@@ -137,10 +134,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param url
* @param url
the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
put
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
protected
Response
put
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -155,10 +152,10 @@ public abstract class AbstractApi {
...
@@ -155,10 +152,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param pathArgs
* @param pathArgs
variable list of arguments used to build the URI
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
delete
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
protected
Response
delete
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -173,10 +170,10 @@ public abstract class AbstractApi {
...
@@ -173,10 +170,10 @@ public abstract class AbstractApi {
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
*
*
* @param expectedStatus the HTTP status that should be returned from the server
* @param expectedStatus the HTTP status that should be returned from the server
* @param queryParams
* @param queryParams
multivalue map of request parameters
* @param url
* @param url
the fully formed path to the GitLab API endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
* @throws GitLabApiException
* @throws GitLabApiException
if any exception occurs during execution
*/
*/
protected
Response
delete
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
protected
Response
delete
(
Response
.
Status
expectedStatus
,
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
GitLabApiException
{
try
{
try
{
...
@@ -189,9 +186,9 @@ public abstract class AbstractApi {
...
@@ -189,9 +186,9 @@ public abstract class AbstractApi {
/**
/**
* Convenience method for adding query and form parameters to a get() or post() call.
* Convenience method for adding query and form parameters to a get() or post() call.
*
*
* @param formData
* @param formData
the Form containing the name/value pairs
* @param name
* @param name
the name of the field/attribute to add
* @param value
* @param value
the value of the field/attribute to add
*/
*/
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
)
throws
IllegalArgumentException
{
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
)
throws
IllegalArgumentException
{
addFormParam
(
formData
,
name
,
value
,
false
);
addFormParam
(
formData
,
name
,
value
,
false
);
...
@@ -201,10 +198,10 @@ public abstract class AbstractApi {
...
@@ -201,10 +198,10 @@ public abstract class AbstractApi {
* Convenience method for adding query and form parameters to a get() or post() call.
* Convenience method for adding query and form parameters to a get() or post() call.
* If required is true and value is null, will throw an IllegalArgumentException.
* If required is true and value is null, will throw an IllegalArgumentException.
*
*
* @param formData
* @param formData
the Form containing the name/value pairs
* @param name
* @param name
the name of the field/attribute to add
* @param value
* @param value
the value of the field/attribute to add
* @param required
* @param required
the field is required flag
* @throws IllegalArgumentException if a required parameter is null or empty
* @throws IllegalArgumentException if a required parameter is null or empty
*/
*/
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
,
boolean
required
)
throws
IllegalArgumentException
{
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
,
boolean
required
)
throws
IllegalArgumentException
{
...
...
src/main/java/com/messners/gitlab/api/CommitsApi.java
View file @
c526865f
...
@@ -9,8 +9,6 @@ import java.util.List;
...
@@ -9,8 +9,6 @@ import java.util.List;
/**
/**
* This class implements the client side API for the GitLab commits calls.
* This class implements the client side API for the GitLab commits calls.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
CommitsApi
extends
AbstractApi
{
public
class
CommitsApi
extends
AbstractApi
{
...
@@ -23,7 +21,7 @@ public class CommitsApi extends AbstractApi {
...
@@ -23,7 +21,7 @@ public class CommitsApi extends AbstractApi {
*
*
* GET /projects/:id/repository/commits
* GET /projects/:id/repository/commits
*
*
* @param projectId
* @param projectId
the project ID to get the list of commits for
* @return a List<Commit> containing the commits for the specified project ID
* @return a List<Commit> containing the commits for the specified project ID
* @throws GitLabApiException
* @throws GitLabApiException
*/
*/
...
@@ -38,7 +36,7 @@ public class CommitsApi extends AbstractApi {
...
@@ -38,7 +36,7 @@ public class CommitsApi extends AbstractApi {
*
*
* GET /projects/:id/repository/commits/:sha
* GET /projects/:id/repository/commits/:sha
*
*
* @param projectId
* @param projectId
the project ID that the commit belongs to
* @param sha a commit hash or name of a branch or tag
* @param sha a commit hash or name of a branch or tag
* @return the Commit instance for the specified project ID/sha pair
* @return the Commit instance for the specified project ID/sha pair
* @throws GitLabApiException
* @throws GitLabApiException
...
@@ -53,7 +51,7 @@ public class CommitsApi extends AbstractApi {
...
@@ -53,7 +51,7 @@ public class CommitsApi extends AbstractApi {
*
*
* GET /projects/:id/repository/commits/:sha/diff
* GET /projects/:id/repository/commits/:sha/diff
*
*
* @param projectId
* @param projectId
the project ID that the commit belongs to
* @param sha a commit hash or name of a branch or tag
* @param sha a commit hash or name of a branch or tag
* @return the Diff instance for the specified project ID/sha pair
* @return the Diff instance for the specified project ID/sha pair
* @throws GitLabApiException
* @throws GitLabApiException
...
...
src/main/java/com/messners/gitlab/api/GitLabApi.java
View file @
c526865f
...
@@ -3,8 +3,6 @@ package com.messners.gitlab.api;
...
@@ -3,8 +3,6 @@ package com.messners.gitlab.api;
/**
/**
* This class is provides a simplified interface to a GitLab API server, and divides the API up into
* This class is provides a simplified interface to a GitLab API server, and divides the API up into
* a separate API class for each concern.
* a separate API class for each concern.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
GitLabApi
{
public
class
GitLabApi
{
...
...
src/main/java/com/messners/gitlab/api/GitLabApiClient.java
View file @
c526865f
...
@@ -31,8 +31,6 @@ import java.util.Map;
...
@@ -31,8 +31,6 @@ import java.util.Map;
/**
/**
* This class utilizes the Jersey client package to communicate with a GitLab API endpoint.
* This class utilizes the Jersey client package to communicate with a GitLab API endpoint.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
GitLabApiClient
{
public
class
GitLabApiClient
{
...
...
src/main/java/com/messners/gitlab/api/GitLabApiException.java
View file @
c526865f
...
@@ -8,9 +8,6 @@ import javax.ws.rs.core.Response.StatusType;
...
@@ -8,9 +8,6 @@ import javax.ws.rs.core.Response.StatusType;
/**
/**
* This is the exception that will be thrown if any exception occurs while communicating
* This is the exception that will be thrown if any exception occurs while communicating
* with a GitLab API endpoint.
* with a GitLab API endpoint.
*
* @author Greg Messner <greg@messners.com>
*
*/
*/
public
class
GitLabApiException
extends
Exception
{
public
class
GitLabApiException
extends
Exception
{
...
...
src/main/java/com/messners/gitlab/api/GroupApi.java
View file @
c526865f
...
@@ -10,8 +10,6 @@ import java.util.List;
...
@@ -10,8 +10,6 @@ import java.util.List;
/**
/**
* This class implements the client side API for the GitLab groups calls.
* This class implements the client side API for the GitLab groups calls.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
GroupApi
extends
AbstractApi
{
public
class
GroupApi
extends
AbstractApi
{
...
...
src/main/java/com/messners/gitlab/api/ISO8601.java
View file @
c526865f
...
@@ -8,8 +8,6 @@ import java.util.TimeZone;
...
@@ -8,8 +8,6 @@ import java.util.TimeZone;
/**
/**
* This class provides utility methods for parsing and formatting ISO8601 formatted dates.
* This class provides utility methods for parsing and formatting ISO8601 formatted dates.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
ISO8601
{
public
class
ISO8601
{
public
static
final
String
PATTERN
=
"yyyy-MM-dd'T'HH:mm:ssZ"
;
public
static
final
String
PATTERN
=
"yyyy-MM-dd'T'HH:mm:ssZ"
;
...
...
src/main/java/com/messners/gitlab/api/JacksonJson.java
View file @
c526865f
...
@@ -29,9 +29,6 @@ import org.codehaus.jackson.map.module.SimpleModule;
...
@@ -29,9 +29,6 @@ import org.codehaus.jackson.map.module.SimpleModule;
/**
/**
* Jackson JSON Configuration and utility class.
* Jackson JSON Configuration and utility class.
*
* @author Greg Messner <greg@messners.com>
*
*/
*/
@Provider
@Provider
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
...
...
src/main/java/com/messners/gitlab/api/MergeRequestApi.java
View file @
c526865f
...
@@ -10,8 +10,6 @@ import java.util.List;
...
@@ -10,8 +10,6 @@ import java.util.List;
/**
/**
* This class implements the client side API for the GitLab merge request calls.
* This class implements the client side API for the GitLab merge request calls.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
MergeRequestApi
extends
AbstractApi
{
public
class
MergeRequestApi
extends
AbstractApi
{
...
...
src/main/java/com/messners/gitlab/api/ProjectApi.java
View file @
c526865f
...
@@ -13,6 +13,9 @@ import java.io.UnsupportedEncodingException;
...
@@ -13,6 +13,9 @@ import java.io.UnsupportedEncodingException;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
java.util.List
;
/**
* This class provides an entry point to all the GitLab API project calls.
*/
public
class
ProjectApi
extends
AbstractApi
{
public
class
ProjectApi
extends
AbstractApi
{
ProjectApi
(
GitLabApi
gitLabApi
)
{
ProjectApi
(
GitLabApi
gitLabApi
)
{
...
...
src/main/java/com/messners/gitlab/api/RepositoryApi.java
View file @
c526865f
...
@@ -12,8 +12,6 @@ import com.messners.gitlab.api.models.TreeItem;
...
@@ -12,8 +12,6 @@ import com.messners.gitlab.api.models.TreeItem;
/**
/**
* This class provides an entry point to all the GitLab API repository calls.
* This class provides an entry point to all the GitLab API repository calls.
*
* @author Greg Messner <greg@messners.com>
*/
*/
public
class
RepositoryApi
extends
AbstractApi
{
public
class
RepositoryApi
extends
AbstractApi
{
...
@@ -78,7 +76,6 @@ public class RepositoryApi extends AbstractApi {
...
@@ -78,7 +76,6 @@ public class RepositoryApi extends AbstractApi {
*
*
* @param projectId
* @param projectId
* @param branchName
* @param branchName
* @return the branch info for the protected branch
* @throws GitLabApiException
* @throws GitLabApiException
*/
*/
public
void
deleteBranch
(
Integer
projectId
,
String
branchName
)
throws
GitLabApiException
{
public
void
deleteBranch
(
Integer
projectId
,
String
branchName
)
throws
GitLabApiException
{
...
...
src/main/java/com/messners/gitlab/api/RepositoryFileApi.java
View file @
c526865f
...
@@ -7,8 +7,6 @@ import com.messners.gitlab.api.models.RepositoryFile;
...
@@ -7,8 +7,6 @@ import com.messners.gitlab.api.models.RepositoryFile;
/**
/**
* This class provides an entry point to all the GitLab API repository files calls.
* This class provides an entry point to all the GitLab API repository files calls.
*
* @author lonfee88 <lonfee88@gmail.com>
*/
*/
public
class
RepositoryFileApi
extends
AbstractApi
{
public
class
RepositoryFileApi
extends
AbstractApi
{
...
...
src/main/java/com/messners/gitlab/api/SessionApi.java
View file @
c526865f
...
@@ -7,9 +7,6 @@ import javax.ws.rs.core.Response;
...
@@ -7,9 +7,6 @@ import javax.ws.rs.core.Response;
/**
/**
* This class implements the client side API for the GitLab login call.
* This class implements the client side API for the GitLab login call.
*
* @author Greg Messner <greg@messners.com>
*
*/
*/
public
class
SessionApi
extends
AbstractApi
{
public
class
SessionApi
extends
AbstractApi
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment