1
1
package org .gitlab4j .api ;
2
2
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 ;
16
3
import java .io .File ;
17
4
import java .io .IOException ;
18
5
import java .io .InputStream ;
22
9
import java .nio .file .StandardCopyOption ;
23
10
import java .util .List ;
24
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 ;
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
+
25
25
/**
26
26
* This class provides an entry point to all the GitLab API repository calls.
27
27
*/
@@ -165,6 +165,7 @@ public Branch unprotectBranch(Integer projectId, String branchName) throws GitLa
165
165
* @param projectId the ID of the project to get the tags for
166
166
* @return the list of tags for the specified project ID
167
167
* @throws GitLabApiException if any exception occurs
168
+ * @deprecated Replaced by TagsApi.getTags(Object)
168
169
*/
169
170
public List <Tag > getTags (Integer projectId ) throws GitLabApiException {
170
171
Response response = get (Response .Status .OK , getDefaultPerPageParam (), "projects" , projectId , "repository" , "tags" );
@@ -181,6 +182,7 @@ public List<Tag> getTags(Integer projectId) throws GitLabApiException {
181
182
* @param perPage the number of Tag instances per page
182
183
* @return the list of tags for the specified project ID
183
184
* @throws GitLabApiException if any exception occurs
185
+ * @deprecated Replaced by TagsApi.getTags(Object, int, int)
184
186
*/
185
187
public List <Tag > getTags (Integer projectId , int page , int perPage ) throws GitLabApiException {
186
188
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
196
198
* @param itemsPerPage the number of Project instances that will be fetched per page
197
199
* @return the list of tags for the specified project ID
198
200
* @throws GitLabApiException if any exception occurs
201
+ * @deprecated Replaced by TagsApi.getTags(Object, int)
199
202
*/
200
203
public Pager <Tag > getTags (Integer projectId , int itemsPerPage ) throws GitLabApiException {
201
204
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
213
216
* @param releaseNotes the release notes for the tag (optional)
214
217
* @return a Tag instance containing info on the newly created tag
215
218
* @throws GitLabApiException if any exception occurs
219
+ * @deprecated Replaced by TagsApi.createTag(Object, String, String, String, String)
216
220
*/
217
221
public Tag createTag (Integer projectId , String tagName , String ref , String message , String releaseNotes ) throws GitLabApiException {
218
222
@@ -225,42 +229,6 @@ public Tag createTag(Integer projectId, String tagName, String ref, String messa
225
229
return (response .readEntity (Tag .class ));
226
230
}
227
231
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
-
264
232
/**
265
233
* Creates a tag on a particular ref of a given project. A message and a File instance containing the
266
234
* 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
275
243
* @param releaseNotesFile a whose contents are the release notes (optional)
276
244
* @return a Tag instance containing info on the newly created tag
277
245
* @throws GitLabApiException if any exception occurs
246
+ * @deprecated Replaced by TagsApi.CreateTag(Object, String, String, String, File)
278
247
*/
279
248
public Tag createTag (Integer projectId , String tagName , String ref , String message , File releaseNotesFile ) throws GitLabApiException {
280
249
@@ -300,6 +269,7 @@ public Tag createTag(Integer projectId, String tagName, String ref, String messa
300
269
* @param projectId the ID of the project
301
270
* @param tagName The name of the tag to delete
302
271
* @throws GitLabApiException if any exception occurs
272
+ * @deprecated Replaced by TagsApi.deleteTag(Object, String)
303
273
*/
304
274
public void deleteTag (Integer projectId , String tagName ) throws GitLabApiException {
305
275
Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
0 commit comments