public class RepositoryFileApi extends AbstractApi
Constructor and Description |
---|
RepositoryFileApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
RepositoryFile |
createFile(RepositoryFile file,
Integer projectId,
String branchName,
String commitMessage)
Create new file in repository
POST /projects/:id/repository/files
file_path (required) - Full path to new file.
|
void |
deleteFile(String filePath,
Integer projectId,
String branchName,
String commitMessage)
Delete existing file in repository
DELETE /projects/:id/repository/files
file_path (required) - Full path to file.
|
RepositoryFile |
getFile(String filePath,
Integer projectId,
String ref)
Get file from repository.
|
RepositoryFile |
updateFile(RepositoryFile file,
Integer projectId,
String branchName,
String commitMessage)
Update existing file in repository
PUT /projects/:id/repository/files
file_path (required) - Full path to new file.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, handle, post, post, post, put, put, validate
public RepositoryFileApi(GitLabApi gitLabApi)
public RepositoryFile getFile(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(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
file
- full path to new file. Ex. lib/class.rbprojectId
- the project IDbranchName
- the name of branchcommitMessage
- the commit messageGitLabApiException
- if any exception occurspublic RepositoryFile updateFile(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
file
- full path to new file. Ex. lib/class.rbprojectId
- the project IDbranchName
- the name of branchcommitMessage
- the commit messageGitLabApiException
- if any exception occurspublic void deleteFile(String filePath, Integer projectId, String branchName, String commitMessage) throws GitLabApiException
filePath
- full path to new file. Ex. lib/class.rbprojectId
- the project IDbranchName
- the name of branchcommitMessage
- the commit messageGitLabApiException
- if any exception occursCopyright © 2017. All rights reserved.