Skip to content

Commit 4b18991

Browse files
committed
Added deprecated tags to all calls replaced by the TagsApi.
1 parent 7e7c391 commit 4b18991

File tree

1 file changed

+19
-49
lines changed

1 file changed

+19
-49
lines changed

src/main/java/org/gitlab4j/api/RepositoryApi.java

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
package org.gitlab4j.api;
22

3-
import org.gitlab4j.api.GitLabApi.ApiVersion;
4-
import org.gitlab4j.api.models.Branch;
5-
import org.gitlab4j.api.models.CompareResults;
6-
import org.gitlab4j.api.models.Contributor;
7-
import org.gitlab4j.api.models.Release;
8-
import org.gitlab4j.api.models.Tag;
9-
import org.gitlab4j.api.models.TreeItem;
10-
import org.gitlab4j.api.utils.FileUtils;
11-
12-
import javax.ws.rs.core.Form;
13-
import javax.ws.rs.core.GenericType;
14-
import javax.ws.rs.core.MediaType;
15-
import javax.ws.rs.core.Response;
163
import java.io.File;
174
import java.io.IOException;
185
import java.io.InputStream;
@@ -22,6 +9,19 @@
229
import java.nio.file.StandardCopyOption;
2310
import java.util.List;
2411

12+
import javax.ws.rs.core.Form;
13+
import javax.ws.rs.core.GenericType;
14+
import javax.ws.rs.core.MediaType;
15+
import javax.ws.rs.core.Response;
16+
17+
import org.gitlab4j.api.GitLabApi.ApiVersion;
18+
import org.gitlab4j.api.models.Branch;
19+
import org.gitlab4j.api.models.CompareResults;
20+
import org.gitlab4j.api.models.Contributor;
21+
import org.gitlab4j.api.models.Tag;
22+
import org.gitlab4j.api.models.TreeItem;
23+
import org.gitlab4j.api.utils.FileUtils;
24+
2525
/**
2626
* This class provides an entry point to all the GitLab API repository calls.
2727
*/
@@ -165,6 +165,7 @@ public Branch unprotectBranch(Integer projectId, String branchName) throws GitLa
165165
* @param projectId the ID of the project to get the tags for
166166
* @return the list of tags for the specified project ID
167167
* @throws GitLabApiException if any exception occurs
168+
* @deprecated Replaced by TagsApi.getTags(Object)
168169
*/
169170
public List<Tag> getTags(Integer projectId) throws GitLabApiException {
170171
Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", projectId, "repository", "tags");
@@ -181,6 +182,7 @@ public List<Tag> getTags(Integer projectId) throws GitLabApiException {
181182
* @param perPage the number of Tag instances per page
182183
* @return the list of tags for the specified project ID
183184
* @throws GitLabApiException if any exception occurs
185+
* @deprecated Replaced by TagsApi.getTags(Object, int, int)
184186
*/
185187
public List<Tag> getTags(Integer projectId, int page, int perPage) throws GitLabApiException {
186188
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", projectId, "repository", "tags");
@@ -196,6 +198,7 @@ public List<Tag> getTags(Integer projectId, int page, int perPage) throws GitLab
196198
* @param itemsPerPage the number of Project instances that will be fetched per page
197199
* @return the list of tags for the specified project ID
198200
* @throws GitLabApiException if any exception occurs
201+
* @deprecated Replaced by TagsApi.getTags(Object, int)
199202
*/
200203
public Pager<Tag> getTags(Integer projectId, int itemsPerPage) throws GitLabApiException {
201204
return (new Pager<Tag>(this, Tag.class, itemsPerPage, null, "projects", projectId, "repository", "tags"));
@@ -213,6 +216,7 @@ public Pager<Tag> getTags(Integer projectId, int itemsPerPage) throws GitLabApiE
213216
* @param releaseNotes the release notes for the tag (optional)
214217
* @return a Tag instance containing info on the newly created tag
215218
* @throws GitLabApiException if any exception occurs
219+
* @deprecated Replaced by TagsApi.createTag(Object, String, String, String, String)
216220
*/
217221
public Tag createTag(Integer projectId, String tagName, String ref, String message, String releaseNotes) throws GitLabApiException {
218222

@@ -225,42 +229,6 @@ public Tag createTag(Integer projectId, String tagName, String ref, String messa
225229
return (response.readEntity(Tag.class));
226230
}
227231

228-
/**
229-
* Add release notes to the existing git tag.
230-
*
231-
* POST /projects/:id/repository/tags/:tagName/release
232-
*
233-
* @param projectId the ID of the project
234-
* @param tagName the name of a tag
235-
* @param releaseNotes release notes with markdown support
236-
* @return a Tag instance containing info on the newly created tag
237-
* @throws GitLabApiException if any exception occurs
238-
*/
239-
public Release createRelease(Integer projectId, String tagName, String releaseNotes) throws GitLabApiException {
240-
Form formData = new GitLabApiForm()
241-
.withParam("description", releaseNotes, false);
242-
Response response = post(Response.Status.CREATED, formData.asMap(), "projects", projectId, "repository", "tags", tagName, "release");
243-
return (response.readEntity(Release.class));
244-
}
245-
246-
/**
247-
* Updates the release notes of a given release.
248-
*
249-
* PUT /projects/:id/repository/tags/:tagName/release
250-
*
251-
* @param projectId the ID of the project
252-
* @param tagName the name of a tag
253-
* @param releaseNotes release notes with markdown support
254-
* @return a Tag instance containing info on the newly created tag
255-
* @throws GitLabApiException if any exception occurs
256-
*/
257-
public Release updateRelease(Integer projectId, String tagName, String releaseNotes) throws GitLabApiException {
258-
Form formData = new GitLabApiForm()
259-
.withParam("description", releaseNotes, false);
260-
Response response = put(Response.Status.CREATED, formData.asMap(), "projects", projectId, "repository", "tags", tagName, "release");
261-
return (response.readEntity(Release.class));
262-
}
263-
264232
/**
265233
* Creates a tag on a particular ref of a given project. A message and a File instance containing the
266234
* release notes are optional. This method is the same as {@link #createTag(Integer, String, String, String, String)},
@@ -275,6 +243,7 @@ public Release updateRelease(Integer projectId, String tagName, String releaseNo
275243
* @param releaseNotesFile a whose contents are the release notes (optional)
276244
* @return a Tag instance containing info on the newly created tag
277245
* @throws GitLabApiException if any exception occurs
246+
* @deprecated Replaced by TagsApi.CreateTag(Object, String, String, String, File)
278247
*/
279248
public Tag createTag(Integer projectId, String tagName, String ref, String message, File releaseNotesFile) throws GitLabApiException {
280249

@@ -300,6 +269,7 @@ public Tag createTag(Integer projectId, String tagName, String ref, String messa
300269
* @param projectId the ID of the project
301270
* @param tagName The name of the tag to delete
302271
* @throws GitLabApiException if any exception occurs
272+
* @deprecated Replaced by TagsApi.deleteTag(Object, String)
303273
*/
304274
public void deleteTag(Integer projectId, String tagName) throws GitLabApiException {
305275
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);

0 commit comments

Comments
 (0)