Class ChangeEditApiImpl
- java.lang.Object
- 
- com.google.gerrit.server.api.changes.ChangeEditApiImpl
 
- 
- All Implemented Interfaces:
- ChangeEditApi
 
 public class ChangeEditApiImpl extends Object implements ChangeEditApi 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.google.gerrit.extensions.api.changes.ChangeEditApiChangeEditApi.ChangeEditDetailRequest, ChangeEditApi.NotImplemented
 
- 
 - 
Constructor SummaryConstructors Constructor Description ChangeEditApiImpl(com.google.inject.Provider<ChangeEdits.Detail> editDetailProvider, ChangeEdits.Post changeEditsPost, DeleteChangeEdit deleteChangeEdit, RebaseChangeEdit.Rebase rebaseChangeEdit, PublishChangeEdit.Publish publishChangeEdit, com.google.inject.Provider<ChangeEdits.Get> changeEditsGetProvider, ChangeEdits.Put changeEditsPut, ChangeEdits.DeleteContent changeEditDeleteContent, com.google.inject.Provider<ChangeEdits.GetMessage> getChangeEditCommitMessageProvider, ChangeEdits.EditMessage modifyChangeEditCommitMessage, ChangeEdits changeEdits, ChangeResource changeResource)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Creates a new change edit.voiddelete()Deletes the change edit.voiddeleteFile(String filePath)Deletes the specified file from the change edit.ChangeEditApi.ChangeEditDetailRequestdetail()Optional<EditInfo>get()Retrieves details regarding the change edit.StringgetCommitMessage()Retrieves the commit message of the change edit.Optional<BinaryResult>getFile(String filePath)Retrieves the contents of the specified file from the change edit.voidmodifyCommitMessage(String newCommitMessage)Modifies the commit message of the change edit.voidmodifyFile(String filePath, RawInput newContent)Modify the contents of the specified file of the change edit.voidpublish()Publishes the change edit using default settings.voidpublish(PublishChangeEditInput publishChangeEditInput)Publishes the change edit.voidrebase()Rebases the change edit on top of the latest patch set of this change.voidrenameFile(String oldFilePath, String newFilePath)Renames a file of the change edit or moves the file to another directory.voidrestoreFile(String filePath)Restores a file of the change edit to the state in which it was before the patch set on which the change edit is based.
 
- 
- 
- 
Constructor Detail- 
ChangeEditApiImpl@Inject public ChangeEditApiImpl(com.google.inject.Provider<ChangeEdits.Detail> editDetailProvider, ChangeEdits.Post changeEditsPost, DeleteChangeEdit deleteChangeEdit, RebaseChangeEdit.Rebase rebaseChangeEdit, PublishChangeEdit.Publish publishChangeEdit, com.google.inject.Provider<ChangeEdits.Get> changeEditsGetProvider, ChangeEdits.Put changeEditsPut, ChangeEdits.DeleteContent changeEditDeleteContent, com.google.inject.Provider<ChangeEdits.GetMessage> getChangeEditCommitMessageProvider, ChangeEdits.EditMessage modifyChangeEditCommitMessage, ChangeEdits changeEdits, ChangeResource changeResource) 
 
- 
 - 
Method Detail- 
detailpublic ChangeEditApi.ChangeEditDetailRequest detail() throws RestApiException - Specified by:
- detailin interface- ChangeEditApi
- Throws:
- RestApiException
 
 - 
getpublic Optional<EditInfo> get() throws RestApiException Description copied from interface:ChangeEditApiRetrieves details regarding the change edit.- Specified by:
- getin interface- ChangeEditApi
- Returns:
- an Optionalcontaining details about the change edit if it exists, orOptional.empty()
- Throws:
- RestApiException- if the change edit couldn't be retrieved
 
 - 
createpublic void create() throws RestApiExceptionDescription copied from interface:ChangeEditApiCreates a new change edit. It has exactly the same Git tree as the current patch set of the change.- Specified by:
- createin interface- ChangeEditApi
- Throws:
- RestApiException- if the change edit couldn't be created or a change edit already exists
 
 - 
deletepublic void delete() throws RestApiExceptionDescription copied from interface:ChangeEditApiDeletes the change edit.- Specified by:
- deletein interface- ChangeEditApi
- Throws:
- RestApiException- if the change edit couldn't be deleted or a change edit wasn't present
 
 - 
rebasepublic void rebase() throws RestApiExceptionDescription copied from interface:ChangeEditApiRebases the change edit on top of the latest patch set of this change.- Specified by:
- rebasein interface- ChangeEditApi
- Throws:
- RestApiException- if the change edit couldn't be rebased or a change edit wasn't present
 
 - 
publishpublic void publish() throws RestApiExceptionDescription copied from interface:ChangeEditApiPublishes the change edit using default settings. SeeChangeEditApi.publish(PublishChangeEditInput)for more details.- Specified by:
- publishin interface- ChangeEditApi
- Throws:
- RestApiException- if the change edit couldn't be published or a change edit wasn't present
 
 - 
publishpublic void publish(PublishChangeEditInput publishChangeEditInput) throws RestApiException Description copied from interface:ChangeEditApiPublishes the change edit. Publishing means that the change edit is turned into a regular patch set of the change.- Specified by:
- publishin interface- ChangeEditApi
- Parameters:
- publishChangeEditInput- a- PublishChangeEditInputspecifying the options which should be applied
- Throws:
- RestApiException- if the change edit couldn't be published or a change edit wasn't present
 
 - 
getFilepublic Optional<BinaryResult> getFile(String filePath) throws RestApiException Description copied from interface:ChangeEditApiRetrieves the contents of the specified file from the change edit.- Specified by:
- getFilein interface- ChangeEditApi
- Parameters:
- filePath- the path of the file
- Returns:
- an Optionalcontaining the contents of the file as aBinaryResultif the file exists within the change edit, orOptional.empty()
- Throws:
- RestApiException- if the contents of the file couldn't be retrieved or a change edit wasn't present
 
 - 
renameFilepublic void renameFile(String oldFilePath, String newFilePath) throws RestApiException Description copied from interface:ChangeEditApiRenames a file of the change edit or moves the file to another directory. If the change edit doesn't exist, it will be created based on the current patch set of the change.- Specified by:
- renameFilein interface- ChangeEditApi
- Parameters:
- oldFilePath- the current file path
- newFilePath- the desired file path
- Throws:
- RestApiException- if the file couldn't be renamed
 
 - 
restoreFilepublic void restoreFile(String filePath) throws RestApiException Description copied from interface:ChangeEditApiRestores a file of the change edit to the state in which it was before the patch set on which the change edit is based. This includes the file content as well as the existence or non-existence of the file. If the change edit doesn't exist, it will be created based on the current patch set of the change.- Specified by:
- restoreFilein interface- ChangeEditApi
- Parameters:
- filePath- the path of the file
- Throws:
- RestApiException- if the file couldn't be restored to its previous state
 
 - 
modifyFilepublic void modifyFile(String filePath, RawInput newContent) throws RestApiException Description copied from interface:ChangeEditApiModify the contents of the specified file of the change edit. If no content is provided, the content of the file is erased but the file isn't deleted. If the change edit doesn't exist, it will be created based on the current patch set of the change.- Specified by:
- modifyFilein interface- ChangeEditApi
- Parameters:
- filePath- the path of the file which should be modified
- newContent- the desired content of the file
- Throws:
- RestApiException- if the content of the file couldn't be modified
 
 - 
deleteFilepublic void deleteFile(String filePath) throws RestApiException Description copied from interface:ChangeEditApiDeletes the specified file from the change edit. If the change edit doesn't exist, it will be created based on the current patch set of the change.- Specified by:
- deleteFilein interface- ChangeEditApi
- Parameters:
- filePath- the path fo the file which should be deleted
- Throws:
- RestApiException- if the file couldn't be deleted
 
 - 
getCommitMessagepublic String getCommitMessage() throws RestApiException Description copied from interface:ChangeEditApiRetrieves the commit message of the change edit.- Specified by:
- getCommitMessagein interface- ChangeEditApi
- Returns:
- the commit message of the change edit
- Throws:
- RestApiException- if the commit message couldn't be retrieved or a change edit wasn't present
 
 - 
modifyCommitMessagepublic void modifyCommitMessage(String newCommitMessage) throws RestApiException Description copied from interface:ChangeEditApiModifies the commit message of the change edit. If the change edit doesn't exist, it will be created based on the current patch set of the change.- Specified by:
- modifyCommitMessagein interface- ChangeEditApi
- Parameters:
- newCommitMessage- the desired commit message
- Throws:
- RestApiException- if the commit message couldn't be modified
 
 
- 
 
-