Commit 76900ce0 authored by Greg Messner's avatar Greg Messner
Browse files

Addd support for getting license and custom attributes (#567)

parent d7c3c76b
...@@ -670,8 +670,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -670,8 +670,7 @@ public class ProjectApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs * @throws GitLabApiException if any exception occurs
*/ */
public Project getProject(Object projectIdOrPath) throws GitLabApiException { public Project getProject(Object projectIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", this.getProjectIdOrPath(projectIdOrPath)); return (getProject(projectIdOrPath, null, null, null));
return (response.readEntity(Project.class));
} }
/** /**
...@@ -684,7 +683,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -684,7 +683,7 @@ public class ProjectApi extends AbstractApi implements Constants {
*/ */
public Optional<Project> getOptionalProject(Object projectIdOrPath) { public Optional<Project> getOptionalProject(Object projectIdOrPath) {
try { try {
return (Optional.ofNullable(getProject(projectIdOrPath))); return (Optional.ofNullable(getProject(projectIdOrPath, null, null, null)));
} catch (GitLabApiException glae) { } catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae)); return (GitLabApi.createOptionalFromException(glae));
} }
...@@ -701,9 +700,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -701,9 +700,7 @@ public class ProjectApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs * @throws GitLabApiException if any exception occurs
*/ */
public Project getProject(Object projectIdOrPath, Boolean includeStatistics) throws GitLabApiException { public Project getProject(Object projectIdOrPath, Boolean includeStatistics) throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("statistics", includeStatistics); return (getProject(projectIdOrPath, includeStatistics, null, null));
Response response = get(Response.Status.OK, formData.asMap(), "projects", this.getProjectIdOrPath(projectIdOrPath));
return (response.readEntity(Project.class));
} }
/** /**
...@@ -717,7 +714,7 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -717,7 +714,7 @@ public class ProjectApi extends AbstractApi implements Constants {
*/ */
public Optional<Project> getOptionalProject(Object projectIdOrPath, Boolean includeStatistics) { public Optional<Project> getOptionalProject(Object projectIdOrPath, Boolean includeStatistics) {
try { try {
return (Optional.ofNullable(getProject(projectIdOrPath, includeStatistics))); return (Optional.ofNullable(getProject(projectIdOrPath, includeStatistics, null, null)));
} catch (GitLabApiException glae) { } catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae)); return (GitLabApi.createOptionalFromException(glae));
} }
......
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