Commit 413f1c2c authored by Greg Messner's avatar Greg Messner
Browse files

Cleaned up Javadocs.

parent d11dff67
...@@ -239,9 +239,10 @@ public abstract class AbstractApi { ...@@ -239,9 +239,10 @@ public abstract class AbstractApi {
return (response); return (response);
} }
/** /**
* Convenience method for adding query and form parameters to a get() or post() call.
* *
* @param formData * @param formData
* @param string * @param string
...@@ -250,14 +251,17 @@ public abstract class AbstractApi { ...@@ -250,14 +251,17 @@ public abstract class AbstractApi {
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);
} }
/** /**
* 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 formData
* @param string * @param name
* @param email * @param value
* @param required * @param required
* @throws IllegalArgumentException
*/ */
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 {
...@@ -277,4 +281,4 @@ public abstract class AbstractApi { ...@@ -277,4 +281,4 @@ public abstract class AbstractApi {
formData.add(name, stringValue); formData.add(name, stringValue);
} }
} }
\ No newline at end of file
...@@ -44,6 +44,23 @@ public class GroupApi extends AbstractApi { ...@@ -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. * Removes group with all projects inside.
* *
...@@ -52,7 +69,7 @@ public class GroupApi extends AbstractApi { ...@@ -52,7 +69,7 @@ public class GroupApi extends AbstractApi {
* @param groupId * @param groupId
* @throws GitLabApiException * @throws GitLabApiException
*/ */
public void deleteGroup (Integer groupId) throws GitLabApiException { public void deleteGroup (Integer groupId) throws GitLabApiException {
if (groupId == null) { if (groupId == null) {
throw new RuntimeException("groupId cannot be null"); throw new RuntimeException("groupId cannot be null");
......
...@@ -8,6 +8,10 @@ import com.sun.jersey.api.client.ClientResponse; ...@@ -8,6 +8,10 @@ import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.GenericType;
import com.sun.jersey.api.representation.Form; import com.sun.jersey.api.representation.Form;
/**
*
* @author Greg Messner <greg@messners.com>
*/
public class MergeRequestApi extends AbstractApi { public class MergeRequestApi extends AbstractApi {
MergeRequestApi (GitLabApi gitLabApi) { MergeRequestApi (GitLabApi gitLabApi) {
...@@ -37,7 +41,7 @@ public class MergeRequestApi extends AbstractApi { ...@@ -37,7 +41,7 @@ public class MergeRequestApi extends AbstractApi {
* *
* @param projectId * @param projectId
* @param mergeRequestId * @param mergeRequestId
* @return * @return the specified MergeRequest instance
* @throws GitLabApiException * @throws GitLabApiException
*/ */
public MergeRequest getMergeRequest (Integer projectId, Integer mergeRequestId) throws GitLabApiException { public MergeRequest getMergeRequest (Integer projectId, Integer mergeRequestId) throws GitLabApiException {
...@@ -125,6 +129,7 @@ public class MergeRequestApi extends AbstractApi { ...@@ -125,6 +129,7 @@ public class MergeRequestApi extends AbstractApi {
* @param projectId * @param projectId
* @param mergeRequestId * @param mergeRequestId
* @param comments * @param comments
* @return
* @throws GitLabApiException * @throws GitLabApiException
*/ */
public MergeRequestComment addMergeRequestComment (Integer projectId, Integer mergeRequestId, String comments) throws GitLabApiException { public MergeRequestComment addMergeRequestComment (Integer projectId, Integer mergeRequestId, String comments) throws GitLabApiException {
......
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