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
ChangeEditApi
get
in interface ChangeEditApi
Optional
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
ChangeEditApi
create
in interface ChangeEditApi
RestApiException
- if the change edit couldn't be created or a change edit already existspublic void delete() throws RestApiException
ChangeEditApi
delete
in interface ChangeEditApi
RestApiException
- if the change edit couldn't be deleted or a change edit wasn't presentpublic void rebase() throws RestApiException
ChangeEditApi
rebase
in interface ChangeEditApi
RestApiException
- if the change edit couldn't be rebased or a change edit wasn't presentpublic void publish() throws RestApiException
ChangeEditApi
ChangeEditApi.publish(PublishChangeEditInput)
for more details.publish
in interface ChangeEditApi
RestApiException
- if the change edit couldn't be published or a change edit wasn't
presentpublic void publish(PublishChangeEditInput publishChangeEditInput) throws RestApiException
ChangeEditApi
publish
in interface ChangeEditApi
publishChangeEditInput
- 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
ChangeEditApi
getFile
in interface ChangeEditApi
filePath
- 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
ChangeEditApi
renameFile
in interface ChangeEditApi
oldFilePath
- the current file pathnewFilePath
- the desired file pathRestApiException
- if the file couldn't be renamedpublic void restoreFile(java.lang.String filePath) throws RestApiException
ChangeEditApi
restoreFile
in interface ChangeEditApi
filePath
- 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
ChangeEditApi
modifyFile
in interface ChangeEditApi
filePath
- 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
ChangeEditApi
deleteFile
in interface ChangeEditApi
filePath
- the path fo the file which should be deletedRestApiException
- if the file couldn't be deletedpublic java.lang.String getCommitMessage() throws RestApiException
ChangeEditApi
getCommitMessage
in interface ChangeEditApi
RestApiException
- if the commit message couldn't be retrieved or a change edit wasn't
presentpublic void modifyCommitMessage(java.lang.String newCommitMessage) throws RestApiException
ChangeEditApi
modifyCommitMessage
in interface ChangeEditApi
newCommitMessage
- the desired commit messageRestApiException
- if the commit message couldn't be modified