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
413f1c2c
Commit
413f1c2c
authored
Mar 27, 2014
by
Greg Messner
Browse files
Cleaned up Javadocs.
parent
d11dff67
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/AbstractApi.java
View file @
413f1c2c
...
...
@@ -239,9 +239,10 @@ public abstract class AbstractApi {
return
(
response
);
}
/**
* Convenience method for adding query and form parameters to a get() or post() call.
*
* @param formData
* @param string
...
...
@@ -250,14 +251,17 @@ public abstract class AbstractApi {
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
)
throws
IllegalArgumentException
{
addFormParam
(
formData
,
name
,
value
,
false
);
}
/**
* 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.
*
* @param formData
* @param
string
* @param
email
* @param
name
* @param
value
* @param required
* @throws IllegalArgumentException
*/
protected
void
addFormParam
(
Form
formData
,
String
name
,
Object
value
,
boolean
required
)
throws
IllegalArgumentException
{
...
...
@@ -277,4 +281,4 @@ public abstract class AbstractApi {
formData
.
add
(
name
,
stringValue
);
}
}
\ No newline at end of file
}
src/main/java/com/messners/gitlab/api/GroupApi.java
View file @
413f1c2c
...
...
@@ -44,6 +44,23 @@ public class GroupApi extends AbstractApi {
}
/**
* Creates a new project group. Available only for admin.
*
* POST /groups
*
* @param name
* @param path
*/
public
void
addGroup
(
String
name
,
String
path
)
throws
GitLabApiException
{
Form
formData
=
new
Form
();
formData
.
add
(
"name"
,
name
);
formData
.
add
(
"path"
,
path
);
post
(
ClientResponse
.
Status
.
OK
,
formData
,
"groups"
);
}
/**
* Removes group with all projects inside.
*
...
...
@@ -52,7 +69,7 @@ public class GroupApi extends AbstractApi {
* @param groupId
* @throws GitLabApiException
*/
public
void
deleteGroup
(
Integer
groupId
)
throws
GitLabApiException
{
public
void
deleteGroup
(
Integer
groupId
)
throws
GitLabApiException
{
if
(
groupId
==
null
)
{
throw
new
RuntimeException
(
"groupId cannot be null"
);
...
...
src/main/java/com/messners/gitlab/api/MergeRequestApi.java
View file @
413f1c2c
...
...
@@ -8,6 +8,10 @@ import com.sun.jersey.api.client.ClientResponse;
import
com.sun.jersey.api.client.GenericType
;
import
com.sun.jersey.api.representation.Form
;
/**
*
* @author Greg Messner <greg@messners.com>
*/
public
class
MergeRequestApi
extends
AbstractApi
{
MergeRequestApi
(
GitLabApi
gitLabApi
)
{
...
...
@@ -37,7 +41,7 @@ public class MergeRequestApi extends AbstractApi {
*
* @param projectId
* @param mergeRequestId
* @return
* @return
the specified MergeRequest instance
* @throws GitLabApiException
*/
public
MergeRequest
getMergeRequest
(
Integer
projectId
,
Integer
mergeRequestId
)
throws
GitLabApiException
{
...
...
@@ -125,6 +129,7 @@ public class MergeRequestApi extends AbstractApi {
* @param projectId
* @param mergeRequestId
* @param comments
* @return
* @throws GitLabApiException
*/
public
MergeRequestComment
addMergeRequestComment
(
Integer
projectId
,
Integer
mergeRequestId
,
String
comments
)
throws
GitLabApiException
{
...
...
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