Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
5c82b3e5
Commit
5c82b3e5
authored
Sep 09, 2019
by
Greg Messner
Browse files
Removed deprecated methods (#429).
parent
bfce0b4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/RepositoryApi.java
View file @
5c82b3e5
...
...
@@ -19,7 +19,6 @@ import org.gitlab4j.api.models.Branch;
import
org.gitlab4j.api.models.Commit
;
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
;
...
...
@@ -195,132 +194,6 @@ public class RepositoryApi extends AbstractApi {
return
(
response
.
readEntity
(
Branch
.
class
));
}
/**
* Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/repository/tags</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @return the list of tags for the specified project ID
* @throws GitLabApiException if any exception occurs
* @deprecated Replaced by TagsApi.getTags(Object)
*/
@Deprecated
public
List
<
Tag
>
getTags
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"tags"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Tag
>>()
{}));
}
/**
* Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/repository/tags</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param page the page to get
* @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)
*/
@Deprecated
public
List
<
Tag
>
getTags
(
Object
projectIdOrPath
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
page
,
perPage
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"tags"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Tag
>>()
{}));
}
/**
* Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/repository/tags</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @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)
*/
@Deprecated
public
Pager
<
Tag
>
getTags
(
Object
projectIdOrPath
,
int
itemsPerPage
)
throws
GitLabApiException
{
return
(
new
Pager
<
Tag
>(
this
,
Tag
.
class
,
itemsPerPage
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"tags"
));
}
/**
* Creates a tag on a particular ref of the given project. A message and release notes are optional.
*
* <pre><code>GitLab Endpoint: POST /projects/:id/repository/tags</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param tagName The name of the tag Must be unique for the project
* @param ref the git ref to place the tag on
* @param message the message to included with the tag (optional)
* @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
(
Object
projectIdOrPath
,
String
tagName
,
String
ref
,
String
message
,
String
releaseNotes
)
throws
GitLabApiException
{
Form
formData
=
new
GitLabApiForm
()
.
withParam
(
"tag_name"
,
tagName
,
true
)
.
withParam
(
"ref"
,
ref
,
true
)
.
withParam
(
"message"
,
message
,
false
)
.
withParam
(
"release_description"
,
releaseNotes
,
false
);
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"tags"
);
return
(
response
.
readEntity
(
Tag
.
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(Object, String, String, String, String)},
* but instead allows the release notes to be supplied in a file.
*
* <pre><code>GitLab Endpoint: POST /projects/:id/repository/tags</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param tagName the name of the tag, must be unique for the project
* @param ref the git ref to place the tag on
* @param message the message to included with the tag (optional)
* @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
(
Object
projectIdOrPath
,
String
tagName
,
String
ref
,
String
message
,
File
releaseNotesFile
)
throws
GitLabApiException
{
String
releaseNotes
;
if
(
releaseNotesFile
!=
null
)
{
try
{
releaseNotes
=
FileUtils
.
readFileContents
(
releaseNotesFile
);
}
catch
(
IOException
ioe
)
{
throw
(
new
GitLabApiException
(
ioe
));
}
}
else
{
releaseNotes
=
null
;
}
return
(
createTag
(
projectIdOrPath
,
tagName
,
ref
,
message
,
releaseNotes
));
}
/**
* Deletes the tag from a project with the specified tag name.
*
* <pre><code>GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @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
(
Object
projectIdOrPath
,
String
tagName
)
throws
GitLabApiException
{
Response
.
Status
expectedStatus
=
(
isApiVersion
(
ApiVersion
.
V3
)
?
Response
.
Status
.
OK
:
Response
.
Status
.
NO_CONTENT
);
delete
(
expectedStatus
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"tags"
,
tagName
);
}
/**
* Get a list of repository files and directories in a project.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment