public class ChangeEditApiImpl extends java.lang.Object implements ChangeEditApi
ChangeEditApi.NotImplemented| Constructor and Description |
|---|
ChangeEditApiImpl(ChangeEdits.Detail editDetail,
ChangeEdits.Post changeEditsPost,
DeleteChangeEdit deleteChangeEdit,
RebaseChangeEdit.Rebase rebaseChangeEdit,
PublishChangeEdit.Publish publishChangeEdit,
ChangeEdits.Get changeEditsGet,
ChangeEdits.Put changeEditsPut,
ChangeEdits.DeleteContent changeEditDeleteContent,
ChangeEdits.GetMessage getChangeEditCommitMessage,
ChangeEdits.EditMessage modifyChangeEditCommitMessage,
ChangeEdits changeEdits,
ChangeResource changeResource) |
| Modifier and Type | Method and Description |
|---|---|
void |
create()
Creates a new change edit.
|
void |
delete()
Deletes the change edit.
|
void |
deleteFile(java.lang.String filePath)
Deletes the specified file from the change edit.
|
java.util.Optional<EditInfo> |
get()
Retrieves details regarding the change edit.
|
java.lang.String |
getCommitMessage()
Retrieves the commit message of the change edit.
|
java.util.Optional<BinaryResult> |
getFile(java.lang.String filePath)
Retrieves the contents of the specified file from the change edit.
|
void |
modifyCommitMessage(java.lang.String newCommitMessage)
Modifies the commit message of the change edit.
|
void |
modifyFile(java.lang.String filePath,
RawInput newContent)
Modify the contents of the specified file of the change edit.
|
void |
publish()
Publishes the change edit using default settings.
|
void |
publish(PublishChangeEditInput publishChangeEditInput)
Publishes the change edit.
|
void |
rebase()
Rebases the change edit on top of the latest patch set of this change.
|
void |
renameFile(java.lang.String oldFilePath,
java.lang.String newFilePath)
Renames a file of the change edit or moves the file to another directory.
|
void |
restoreFile(java.lang.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.
|
@Inject public ChangeEditApiImpl(ChangeEdits.Detail editDetail, ChangeEdits.Post changeEditsPost, DeleteChangeEdit deleteChangeEdit, RebaseChangeEdit.Rebase rebaseChangeEdit, PublishChangeEdit.Publish publishChangeEdit, ChangeEdits.Get changeEditsGet, ChangeEdits.Put changeEditsPut, ChangeEdits.DeleteContent changeEditDeleteContent, ChangeEdits.GetMessage getChangeEditCommitMessage, ChangeEdits.EditMessage modifyChangeEditCommitMessage, ChangeEdits changeEdits, ChangeResource changeResource)
public java.util.Optional<EditInfo> get() throws RestApiException
ChangeEditApiget in interface ChangeEditApiOptional containing details about the change edit if it exists, or Optional.empty()RestApiException - if the change edit couldn't be retrievedpublic void create()
throws RestApiException
ChangeEditApicreate in interface ChangeEditApiRestApiException - if the change edit couldn't be created or a change edit already existspublic void delete()
throws RestApiException
ChangeEditApidelete in interface ChangeEditApiRestApiException - if the change edit couldn't be deleted or a change edit wasn't presentpublic void rebase()
throws RestApiException
ChangeEditApirebase in interface ChangeEditApiRestApiException - if the change edit couldn't be rebased or a change edit wasn't presentpublic void publish()
throws RestApiException
ChangeEditApiChangeEditApi.publish(PublishChangeEditInput)
for more details.publish in interface ChangeEditApiRestApiException - if the change edit couldn't be published or a change edit wasn't
presentpublic void publish(PublishChangeEditInput publishChangeEditInput) throws RestApiException
ChangeEditApipublish in interface ChangeEditApipublishChangeEditInput - a PublishChangeEditInput specifying the options which
should be appliedRestApiException - if the change edit couldn't be published or a change edit wasn't
presentpublic java.util.Optional<BinaryResult> getFile(java.lang.String filePath) throws RestApiException
ChangeEditApigetFile in interface ChangeEditApifilePath - the path of the fileOptional containing the contents of the file as a BinaryResult if
the file exists within the change edit, or Optional.empty()RestApiException - if the contents of the file couldn't be retrieved or a change edit
wasn't presentpublic void renameFile(java.lang.String oldFilePath,
java.lang.String newFilePath)
throws RestApiException
ChangeEditApirenameFile in interface ChangeEditApioldFilePath - the current file pathnewFilePath - the desired file pathRestApiException - if the file couldn't be renamedpublic void restoreFile(java.lang.String filePath)
throws RestApiException
ChangeEditApirestoreFile in interface ChangeEditApifilePath - the path of the fileRestApiException - if the file couldn't be restored to its previous statepublic void modifyFile(java.lang.String filePath,
RawInput newContent)
throws RestApiException
ChangeEditApimodifyFile in interface ChangeEditApifilePath - the path of the file which should be modifiednewContent - the desired content of the fileRestApiException - if the content of the file couldn't be modifiedpublic void deleteFile(java.lang.String filePath)
throws RestApiException
ChangeEditApideleteFile in interface ChangeEditApifilePath - the path fo the file which should be deletedRestApiException - if the file couldn't be deletedpublic java.lang.String getCommitMessage()
throws RestApiException
ChangeEditApigetCommitMessage in interface ChangeEditApiRestApiException - if the commit message couldn't be retrieved or a change edit wasn't
presentpublic void modifyCommitMessage(java.lang.String newCommitMessage)
throws RestApiException
ChangeEditApimodifyCommitMessage in interface ChangeEditApinewCommitMessage - the desired commit messageRestApiException - if the commit message couldn't be modified