diff --git a/src/main/java/org/gitlab4j/api/RepositoryApi.java b/src/main/java/org/gitlab4j/api/RepositoryApi.java index 2d0e36856e3f2c6bb3156c09a29757f49350006e..acf2634d6c9cb4646e9d3e0300d5e2a2c0a2d6a0 100644 --- a/src/main/java/org/gitlab4j/api/RepositoryApi.java +++ b/src/main/java/org/gitlab4j/api/RepositoryApi.java @@ -1,18 +1,5 @@ package org.gitlab4j.api; -import org.gitlab4j.api.GitLabApi.ApiVersion; -import org.gitlab4j.api.models.Branch; -import org.gitlab4j.api.models.CompareResults; -import org.gitlab4j.api.models.Contributor; -import org.gitlab4j.api.models.Release; -import org.gitlab4j.api.models.Tag; -import org.gitlab4j.api.models.TreeItem; -import org.gitlab4j.api.utils.FileUtils; - -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -22,6 +9,19 @@ import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.util.List; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.gitlab4j.api.GitLabApi.ApiVersion; +import org.gitlab4j.api.models.Branch; +import org.gitlab4j.api.models.CompareResults; +import org.gitlab4j.api.models.Contributor; +import org.gitlab4j.api.models.Tag; +import org.gitlab4j.api.models.TreeItem; +import org.gitlab4j.api.utils.FileUtils; + /** * This class provides an entry point to all the GitLab API repository calls. */ @@ -165,6 +165,7 @@ public class RepositoryApi extends AbstractApi { * @param projectId the ID of the project to get the tags for * @return the list of tags for the specified project ID * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.getTags(Object) */ public List getTags(Integer projectId) throws GitLabApiException { Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", projectId, "repository", "tags"); @@ -181,6 +182,7 @@ public class RepositoryApi extends AbstractApi { * @param perPage the number of Tag instances per page * @return the list of tags for the specified project ID * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.getTags(Object, int, int) */ public List getTags(Integer projectId, int page, int perPage) throws GitLabApiException { Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", projectId, "repository", "tags"); @@ -196,6 +198,7 @@ public class RepositoryApi extends AbstractApi { * @param itemsPerPage the number of Project instances that will be fetched per page * @return the list of tags for the specified project ID * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.getTags(Object, int) */ public Pager getTags(Integer projectId, int itemsPerPage) throws GitLabApiException { return (new Pager(this, Tag.class, itemsPerPage, null, "projects", projectId, "repository", "tags")); @@ -213,6 +216,7 @@ public class RepositoryApi extends AbstractApi { * @param releaseNotes the release notes for the tag (optional) * @return a Tag instance containing info on the newly created tag * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.createTag(Object, String, String, String, String) */ public Tag createTag(Integer projectId, String tagName, String ref, String message, String releaseNotes) throws GitLabApiException { @@ -225,42 +229,6 @@ public class RepositoryApi extends AbstractApi { return (response.readEntity(Tag.class)); } - /** - * Add release notes to the existing git tag. - * - * POST /projects/:id/repository/tags/:tagName/release - * - * @param projectId the ID of the project - * @param tagName the name of a tag - * @param releaseNotes release notes with markdown support - * @return a Tag instance containing info on the newly created tag - * @throws GitLabApiException if any exception occurs - */ - public Release createRelease(Integer projectId, String tagName, String releaseNotes) throws GitLabApiException { - Form formData = new GitLabApiForm() - .withParam("description", releaseNotes, false); - Response response = post(Response.Status.CREATED, formData.asMap(), "projects", projectId, "repository", "tags", tagName, "release"); - return (response.readEntity(Release.class)); - } - - /** - * Updates the release notes of a given release. - * - * PUT /projects/:id/repository/tags/:tagName/release - * - * @param projectId the ID of the project - * @param tagName the name of a tag - * @param releaseNotes release notes with markdown support - * @return a Tag instance containing info on the newly created tag - * @throws GitLabApiException if any exception occurs - */ - public Release updateRelease(Integer projectId, String tagName, String releaseNotes) throws GitLabApiException { - Form formData = new GitLabApiForm() - .withParam("description", releaseNotes, false); - Response response = put(Response.Status.CREATED, formData.asMap(), "projects", projectId, "repository", "tags", tagName, "release"); - return (response.readEntity(Release.class)); - } - /** * Creates a tag on a particular ref of a given project. A message and a File instance containing the * release notes are optional. This method is the same as {@link #createTag(Integer, String, String, String, String)}, @@ -275,6 +243,7 @@ public class RepositoryApi extends AbstractApi { * @param releaseNotesFile a whose contents are the release notes (optional) * @return a Tag instance containing info on the newly created tag * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.CreateTag(Object, String, String, String, File) */ public Tag createTag(Integer projectId, String tagName, String ref, String message, File releaseNotesFile) throws GitLabApiException { @@ -300,6 +269,7 @@ public class RepositoryApi extends AbstractApi { * @param projectId the ID of the project * @param tagName The name of the tag to delete * @throws GitLabApiException if any exception occurs + * @deprecated Replaced by TagsApi.deleteTag(Object, String) */ public void deleteTag(Integer projectId, String tagName) throws GitLabApiException { Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);