public class RepositoryApi extends AbstractApi
Constants.ActionType, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor and Description |
---|
RepositoryApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
CompareResults |
compare(Object projectIdOrPath,
String from,
String to)
Compare branches, tags or commits.
|
Branch |
createBranch(Object projectIdOrPath,
String branchName,
String ref)
Creates a branch for the project.
|
Tag |
createTag(Object projectIdOrPath,
String tagName,
String ref,
String message,
File releaseNotesFile)
Deprecated.
Replaced by TagsApi.CreateTag(Object, String, String, String, File)
|
Tag |
createTag(Object projectIdOrPath,
String tagName,
String ref,
String message,
String releaseNotes)
Deprecated.
Replaced by TagsApi.createTag(Object, String, String, String, String)
|
void |
deleteBranch(Object projectIdOrPath,
String branchName)
Delete a single project repository branch.
|
void |
deleteTag(Object projectIdOrPath,
String tagName)
Deprecated.
Replaced by TagsApi.deleteTag(Object, String)
|
Branch |
getBranch(Object projectIdOrPath,
String branchName)
Get a single project repository branch.
|
List<Branch> |
getBranches(Object projectIdOrPath)
Get a list of repository branches from a project, sorted by name alphabetically.
|
Pager<Branch> |
getBranches(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of repository branches from a project, sorted by name alphabetically.
|
List<Branch> |
getBranches(Object projectIdOrPath,
int page,
int perPage)
Get a list of repository branches from a project, sorted by name alphabetically.
|
Stream<Branch> |
getBranchesStream(Object projectIdOrPath)
Get a Stream of repository branches from a project, sorted by name alphabetically.
|
List<Contributor> |
getContributors(Object projectIdOrPath)
Get a list of contributors from a project.
|
Pager<Contributor> |
getContributors(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of contributors from a project.
|
List<Contributor> |
getContributors(Object projectIdOrPath,
int page,
int perPage)
Get a list of contributors from a project and in the specified page range.
|
Stream<Contributor> |
getContributorsStream(Object projectIdOrPath)
Get a list of contributors from a project.
|
Optional<Branch> |
getOptionalBranch(Object projectIdOrPath,
String branchName)
Get an Optional instance with the value for the specific repository branch.
|
InputStream |
getRawBlobContent(Object projectIdOrPath,
String sha)
Get the raw file contents for a blob by blob SHA.
|
InputStream |
getRepositoryArchive(Object projectIdOrPath,
String sha)
Get an archive of the complete repository by SHA (optional).
|
InputStream |
getRepositoryArchive(Object projectIdOrPath,
String sha,
Constants.ArchiveFormat format)
Get an archive of the complete repository by SHA (optional).
|
File |
getRepositoryArchive(Object projectIdOrPath,
String sha,
File directory)
Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
|
File |
getRepositoryArchive(Object projectIdOrPath,
String sha,
File directory,
Constants.ArchiveFormat format)
Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
|
File |
getRepositoryArchive(Object projectIdOrPath,
String sha,
File directory,
String format)
Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
|
InputStream |
getRepositoryArchive(Object projectIdOrPath,
String sha,
String format)
Get an archive of the complete repository by SHA (optional).
|
List<Tag> |
getTags(Object projectIdOrPath)
Deprecated.
Replaced by TagsApi.getTags(Object)
|
Pager<Tag> |
getTags(Object projectIdOrPath,
int itemsPerPage)
Deprecated.
Replaced by TagsApi.getTags(Object, int)
|
List<Tag> |
getTags(Object projectIdOrPath,
int page,
int perPage)
Deprecated.
Replaced by TagsApi.getTags(Object, int, int)
|
List<TreeItem> |
getTree(Object projectIdOrPath)
Get a list of repository files and directories in a project.
|
Pager<TreeItem> |
getTree(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of repository files and directories in a project.
|
List<TreeItem> |
getTree(Object projectIdOrPath,
String filePath,
String refName)
Get a list of repository files and directories in a project.
|
List<TreeItem> |
getTree(Object projectIdOrPath,
String filePath,
String refName,
Boolean recursive)
Get a list of repository files and directories in a project.
|
Pager<TreeItem> |
getTree(Object projectIdOrPath,
String filePath,
String refName,
Boolean recursive,
int itemsPerPage)
Get a Pager of repository files and directories in a project.
|
Pager<TreeItem> |
getTree(Object projectIdOrPath,
String filePath,
String refName,
int itemsPerPage)
Get a Pager of repository files and directories in a project.
|
Stream<TreeItem> |
getTreeStream(Object projectIdOrPath)
Get a list of repository files and directories in a project.
|
Stream<TreeItem> |
getTreeStream(Object projectIdOrPath,
String filePath,
String refName)
Get a Stream of repository files and directories in a project.
|
Stream<TreeItem> |
getTreeStream(Object projectIdOrPath,
String filePath,
String refName,
Boolean recursive)
Get a Stream of repository files and directories in a project.
|
Branch |
protectBranch(Object projectIdOrPath,
String branchName)
Protects a single project repository branch.
|
Branch |
unprotectBranch(Object projectIdOrPath,
String branchName)
Unprotects a single project repository branch.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, urlEncode, validate
public RepositoryApi(GitLabApi gitLabApi)
public List<Branch> getBranches(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<Branch> getBranches(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Branch instances per pageGitLabApiException
- if any exception occurspublic Pager<Branch> getBranches(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<Branch> getBranchesStream(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic Branch getBranch(Object projectIdOrPath, String branchName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to getGitLabApiException
- if any exception occurspublic Optional<Branch> getOptionalBranch(Object projectIdOrPath, String branchName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to getGitLabApiException
- if any exception occurspublic Branch createBranch(Object projectIdOrPath, String branchName, String ref) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to createref
- Source to create the branch from, can be an existing branch, tag or commit SHAGitLabApiException
- if any exception occurspublic void deleteBranch(Object projectIdOrPath, String branchName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to deleteGitLabApiException
- if any exception occurspublic Branch protectBranch(Object projectIdOrPath, String branchName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to protectGitLabApiException
- if any exception occurspublic Branch unprotectBranch(Object projectIdOrPath, String branchName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancebranchName
- the name of the branch to un-protectGitLabApiException
- if any exception occurs@Deprecated public List<Tag> getTags(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurs@Deprecated public List<Tag> getTags(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Tag instances per pageGitLabApiException
- if any exception occurs@Deprecated public Pager<Tag> getTags(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Tag createTag(Object projectIdOrPath, String tagName, String ref, String message, String releaseNotes) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancetagName
- The name of the tag Must be unique for the projectref
- the git ref to place the tag onmessage
- the message to included with the tag (optional)releaseNotes
- the release notes for the tag (optional)GitLabApiException
- if any exception occurspublic Tag createTag(Object projectIdOrPath, String tagName, String ref, String message, File releaseNotesFile) throws GitLabApiException
createTag(Object, String, String, String, String)
,
but instead allows the release notes to be supplied in a file.
POST /projects/:id/repository/tagsprojectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancetagName
- the name of the tag, must be unique for the projectref
- the git ref to place the tag onmessage
- the message to included with the tag (optional)releaseNotesFile
- a whose contents are the release notes (optional)GitLabApiException
- if any exception occurspublic void deleteTag(Object projectIdOrPath, String tagName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancetagName
- The name of the tag to deleteGitLabApiException
- if any exception occurspublic List<TreeItem> getTree(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic Pager<TreeItem> getTree(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<TreeItem> getTreeStream(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<TreeItem> getTree(Object projectIdOrPath, String filePath, String refName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchGitLabApiException
- if any exception occurspublic Pager<TreeItem> getTree(Object projectIdOrPath, String filePath, String refName, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<TreeItem> getTreeStream(Object projectIdOrPath, String filePath, String refName) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchGitLabApiException
- if any exception occurspublic List<TreeItem> getTree(Object projectIdOrPath, String filePath, String refName, Boolean recursive) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchrecursive
- flag to get a recursive tree or notGitLabApiException
- if any exception occurspublic Pager<TreeItem> getTree(Object projectIdOrPath, String filePath, String refName, Boolean recursive, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchrecursive
- flag to get a recursive tree or notitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<TreeItem> getTreeStream(Object projectIdOrPath, String filePath, String refName, Boolean recursive) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefilePath
- the path inside repository, used to get content of subdirectoriesrefName
- the name of a repository branch or tag or if not given the default branchrecursive
- flag to get a recursive tree or notGitLabApiException
- if any exception occurspublic InputStream getRawBlobContent(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the file to get the contents forGitLabApiException
- if any exception occurspublic InputStream getRepositoryArchive(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getGitLabApiException
- if any exception occurspublic InputStream getRepositoryArchive(Object projectIdOrPath, String sha, String format) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getformat
- The archive format, defaults to "tar.gz" if nullGitLabApiException
- if format is not a valid archive format or any exception occurspublic InputStream getRepositoryArchive(Object projectIdOrPath, String sha, Constants.ArchiveFormat format) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getformat
- The archive format, defaults to TAR_GZ if nullGitLabApiException
- if any exception occurspublic File getRepositoryArchive(Object projectIdOrPath, String sha, File directory) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getdirectory
- the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"GitLabApiException
- if any exception occurspublic File getRepositoryArchive(Object projectIdOrPath, String sha, File directory, String format) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getdirectory
- the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"format
- The archive format, defaults to "tar.gz" if nullGitLabApiException
- if format is not a valid archive format or any exception occurspublic File getRepositoryArchive(Object projectIdOrPath, String sha, File directory, Constants.ArchiveFormat format) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesha
- the SHA of the archive to getdirectory
- the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"format
- The archive format, defaults to TAR_GZ if nullGitLabApiException
- if any exception occurspublic CompareResults compare(Object projectIdOrPath, String from, String to) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancefrom
- the commit SHA or branch nameto
- the commit SHA or branch nameGitLabApiException
- if any exception occurspublic List<Contributor> getContributors(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<Contributor> getContributors(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of projects per pageGitLabApiException
- if any exception occurspublic Pager<Contributor> getContributors(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<Contributor> getContributorsStream(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occursCopyright © 2018. All rights reserved.