public interface ChangeEditApi
publish(PublishChangeEditInput)). Whenever the descriptions
below refer to files of a change edit, they actually refer to the files of the Git tree which is
represented by the change edit. A change can have at most one change edit at each point in time.| Modifier and Type | Interface and Description |
|---|---|
static class |
ChangeEditApi.NotImplemented
A default implementation which allows source compatibility when adding new methods to the
interface.
|
| 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.
|
java.util.Optional<EditInfo> get() throws RestApiException
Optional containing details about the change edit if it exists, or Optional.empty()RestApiException - if the change edit couldn't be retrievedvoid create()
throws RestApiException
RestApiException - if the change edit couldn't be created or a change edit already existsvoid delete()
throws RestApiException
RestApiException - if the change edit couldn't be deleted or a change edit wasn't presentvoid rebase()
throws RestApiException
RestApiException - if the change edit couldn't be rebased or a change edit wasn't presentvoid publish()
throws RestApiException
publish(PublishChangeEditInput)
for more details.RestApiException - if the change edit couldn't be published or a change edit wasn't
presentvoid publish(PublishChangeEditInput publishChangeEditInput) throws RestApiException
publishChangeEditInput - a PublishChangeEditInput specifying the options which
should be appliedRestApiException - if the change edit couldn't be published or a change edit wasn't
presentjava.util.Optional<BinaryResult> getFile(java.lang.String filePath) throws RestApiException
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 presentvoid renameFile(java.lang.String oldFilePath,
java.lang.String newFilePath)
throws RestApiException
oldFilePath - the current file pathnewFilePath - the desired file pathRestApiException - if the file couldn't be renamedvoid restoreFile(java.lang.String filePath)
throws RestApiException
filePath - the path of the fileRestApiException - if the file couldn't be restored to its previous statevoid modifyFile(java.lang.String filePath,
RawInput newContent)
throws RestApiException
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 modifiedvoid deleteFile(java.lang.String filePath)
throws RestApiException
filePath - the path fo the file which should be deletedRestApiException - if the file couldn't be deletedjava.lang.String getCommitMessage()
throws RestApiException
RestApiException - if the commit message couldn't be retrieved or a change edit wasn't
presentvoid modifyCommitMessage(java.lang.String newCommitMessage)
throws RestApiException
newCommitMessage - the desired commit messageRestApiException - if the commit message couldn't be modified