public class RepositoryFileApi 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.TokenTypeNEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER| Constructor and Description |
|---|
RepositoryFileApi(GitLabApi gitLabApi) |
| Modifier and Type | Method and Description |
|---|---|
RepositoryFile |
createFile(Object projectIdOrPath,
RepositoryFile file,
String branchName,
String commitMessage)
Create new file in repository
POST /projects/:id/repository/files
file_path (required) - Full path to new file.
|
RepositoryFile |
createFile(RepositoryFile file,
Integer projectId,
String branchName,
String commitMessage)
Deprecated.
Will be removed in version 5.0, replaced by
createFile(Object, RepositoryFile, String, String) |
protected javax.ws.rs.core.Form |
createForm(RepositoryFile file,
String branchName,
String commitMessage)
Gets the query params based on the API version.
|
void |
deleteFile(Object projectIdOrPath,
String filePath,
String branchName,
String commitMessage)
Delete existing file in repository
DELETE /projects/:id/repository/files
file_path (required) - Full path to file.
|
void |
deleteFile(String filePath,
Integer projectId,
String branchName,
String commitMessage)
Deprecated.
Will be removed in version 5.0, replaced by
deleteFile(Object, String, String, String) |
RepositoryFile |
getFile(Object projectIdOrPath,
String filePath,
String ref)
Get file from repository.
|
RepositoryFile |
getFile(Object projectIdOrPath,
String filePath,
String ref,
boolean includeContent)
Get file from repository.
|
RepositoryFile |
getFile(String filePath,
Integer projectId,
String ref)
Deprecated.
Will be removed in version 5.0, replaced by
getFile(Object, String, String) |
RepositoryFile |
getFileInfo(Object projectIdOrPath,
String filePath,
String ref)
Get information on a file in the repository.
|
protected RepositoryFile |
getFileV3(String filePath,
Integer projectId,
String ref)
Deprecated.
Will be removed in version 5.0
|
Optional<RepositoryFile> |
getOptionalFile(Object projectIdOrPath,
String filePath,
String ref)
Get an Optional instance with the value holding information and content for a file in the repository.
|
Optional<RepositoryFile> |
getOptionalFileInfo(Object projectIdOrPath,
String filePath,
String ref)
Get an Optional instance with the value holding information on a file in the repository.
|
InputStream |
getRawFile(Object projectIdOrPath,
String commitOrBranchName,
String filepath)
Get the raw file contents for a file by commit sha and path.
|
File |
getRawFile(Object projectIdOrPath,
String commitOrBranchName,
String filepath,
File directory)
Get the raw file for the file by commit sha and path.
|
RepositoryFile |
updateFile(Object projectIdOrPath,
RepositoryFile file,
String branchName,
String commitMessage)
Update existing file in repository
PUT /projects/:id/repository/files
file_path (required) - Full path to new file.
|
RepositoryFile |
updateFile(RepositoryFile file,
Integer projectId,
String branchName,
String commitMessage)
Deprecated.
Will be removed in version 5.0, replaced by
updateFile(Object, RepositoryFile, String, String) |
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, validatepublic RepositoryFileApi(GitLabApi gitLabApi)
public Optional<RepositoryFile> getOptionalFileInfo(Object projectIdOrPath, String filePath, String ref)
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - (required) - Full path to the file. Ex. lib/class.rbref - (required) - The name of branch, tag or commitpublic RepositoryFile getFileInfo(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - (required) - Full path to the file. Ex. lib/class.rbref - (required) - The name of branch, tag or commitGitLabApiException - if any exception occurspublic Optional<RepositoryFile> getOptionalFile(Object projectIdOrPath, String filePath, String ref)
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - (required) - Full path to the file. Ex. lib/class.rbref - (required) - The name of branch, tag or commitpublic RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - (required) - Full path to the file. Ex. lib/class.rbref - (required) - The name of branch, tag or commitGitLabApiException - if any exception occurs@Deprecated public RepositoryFile getFile(String filePath, Integer projectId, String ref) throws GitLabApiException
getFile(Object, String, String)filePath - (required) - Full path to the file. Ex. lib/class.rbprojectId - (required) - the project IDref - (required) - The name of branch, tag or commitGitLabApiException - if any exception occurspublic RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref, boolean includeContent) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - (required) - Full path to the file. Ex. lib/class.rbref - (required) - The name of branch, tag or commitincludeContent - if true will also fetch file contentGitLabApiException - if any exception occurs@Deprecated protected RepositoryFile getFileV3(String filePath, Integer projectId, String ref) throws GitLabApiException
filePath - (required) - Full path to new file. Ex. lib/class.rbprojectId - (required) - the project IDref - (required) - The name of branch, tag or commitGitLabApiException - if any exception occurspublic RepositoryFile createFile(Object projectIdOrPath, RepositoryFile file, String branchName, String commitMessage) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfile - a ReposityoryFile instance with info for the file to createbranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurs@Deprecated public RepositoryFile createFile(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
createFile(Object, RepositoryFile, String, String)file - a ReposityoryFile instance with info for the file to createprojectId - the project IDbranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurspublic RepositoryFile updateFile(Object projectIdOrPath, RepositoryFile file, String branchName, String commitMessage) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfile - a ReposityoryFile instance with info for the file to updatebranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurs@Deprecated public RepositoryFile updateFile(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
updateFile(Object, RepositoryFile, String, String)file - a ReposityoryFile instance with info for the file to updateprojectId - the project IDbranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurspublic void deleteFile(Object projectIdOrPath, String filePath, String branchName, String commitMessage) throws GitLabApiException
projectIdOrPath - the id, path of the project, or a Project instance holding the project ID or pathfilePath - full path to new file. Ex. lib/class.rbbranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurs@Deprecated public void deleteFile(String filePath, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
deleteFile(Object, String, String, String)filePath - full path to new file. Ex. lib/class.rbprojectId - the project IDbranchName - the name of branchcommitMessage - the commit messageGitLabApiException - if any exception occurspublic File getRawFile(Object projectIdOrPath, String commitOrBranchName, String filepath, File directory) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancecommitOrBranchName - the commit or branch name to get the file forfilepath - the path of the file to getdirectory - the File instance of the directory to save the file to, if null will use "java.io.tmpdir"GitLabApiException - if any exception occurspublic InputStream getRawFile(Object projectIdOrPath, String commitOrBranchName, String filepath) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancecommitOrBranchName - the commit or branch name to get the file contents forfilepath - the path of the file to getGitLabApiException - if any exception occursprotected javax.ws.rs.core.Form createForm(RepositoryFile file, String branchName, String commitMessage)
file - the RepositoryFile instance with the info for the query paramsbranchName - the branch namecommitMessage - the commit messageCopyright © 2018. All rights reserved.