public class RepositoryApi extends AbstractApi
Constructor and Description |
---|
RepositoryApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
Branch |
createBranch(Integer projectId,
String branchName,
String ref)
Creates a branch for the project.
|
void |
deleteBranch(Integer projectId,
String branchName)
Delete a single project repository branch.
|
Branch |
getBranch(Integer projectId,
String branchName)
Get a single project repository branch.
|
List<Branch> |
getBranches(Integer projectId)
Get a list of repository branches from a project, sorted by name alphabetically.
|
String |
getRawBlobCotent(Integer projectId,
String sha)
Get the raw file contents for a blob by blob SHA.
|
String |
getRawFileContent(Integer projectId,
String commitOrBranchName,
String filepath)
Get the raw file contents for a file by commit sha and path.
|
InputStream |
getRepositoryArchive(Integer projectId,
String sha)
Get an archive of the complete repository by SHA (optional).
|
File |
getRepositoryArchive(Integer projectId,
String sha,
File directory)
Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
|
List<Tag> |
getTags(Integer projectId)
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
|
List<TreeItem> |
getTree(Integer projectId)
Get a list of repository files and directories in a project.
|
List<TreeItem> |
getTree(Integer projectId,
String filePath,
String refName)
Get a list of repository files and directories in a project.
|
List<TreeItem> |
getTree(Integer projectId,
String filePath,
String refName,
Boolean recursive)
Get a list of repository files and directories in a project.
|
Branch |
protectBranch(Integer projectId,
String branchName)
Protects a single project repository branch.
|
Branch |
unprotectBranch(Integer projectId,
String branchName)
Unprotects a single project repository branch.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, handle, post, post, post, put, put, validate
public RepositoryApi(GitLabApi gitLabApi)
public List<Branch> getBranches(Integer projectId) throws GitLabApiException
projectId
- GitLabApiException
public Branch getBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- branchName
- GitLabApiException
public Branch createBranch(Integer projectId, String branchName, String ref) throws GitLabApiException
projectId
- the project to create the branch forbranchName
- the name of the branch to createref
- Source to create the branch from, can be an existing branch, tag or commit SHAGitLabApiException
public void deleteBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- branchName
- GitLabApiException
public Branch protectBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- branchName
- GitLabApiException
public Branch unprotectBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- branchName
- GitLabApiException
public List<Tag> getTags(Integer projectId) throws GitLabApiException
projectId
- GitLabApiException
public List<TreeItem> getTree(Integer projectId) throws GitLabApiException
projectId
- GitLabApiException
public List<TreeItem> getTree(Integer projectId, String filePath, String refName) throws GitLabApiException
projectId
- filePath
- refName
- GitLabApiException
public List<TreeItem> getTree(Integer projectId, String filePath, String refName, Boolean recursive) throws GitLabApiException
projectId
- filePath
- refName
- recursive
- GitLabApiException
public String getRawFileContent(Integer projectId, String commitOrBranchName, String filepath) throws GitLabApiException
projectId
- commitOrBranchName
- GitLabApiException
public String getRawBlobCotent(Integer projectId, String sha) throws GitLabApiException
projectId
- sha
- GitLabApiException
public InputStream getRepositoryArchive(Integer projectId, String sha) throws GitLabApiException
projectId
- sha
- GitLabApiException
public File getRepositoryArchive(Integer projectId, String sha, File directory) throws GitLabApiException
projectId
- sha
- directory
- the File instance of the directory to save the archive to, if null will use "java.io.tmpdir"GitLabApiException
Copyright © 2017. All rights reserved.