Class EditFileRequest

java.lang.Object
com.atlassian.bitbucket.content.EditFileRequest

public class EditFileRequest extends Object
Represents a request to edit a file, this request can be used to create a new file as well as updating an existing file.

The following properties are required:

  • getBranch(): The name of the branch on which the edit should happen
  • getPath(): The path of the file
  • getRepository(): The repository in which the edit operation should be done
  • getContent(): A supplier providing access to the file content
If getSourceCommitId() is not provided, it's assumed the file doesn't exist on the branch and a new file will be created.
Since:
4.13
See Also:
  • Method Details

    • getAuthor

      @Nonnull public Optional<ApplicationUser> getAuthor()
      The author of the commit, if provided. If not provided, the author of the commit will be the currently authenticated user.
      Since:
      7.13
    • getBranch

      @Nonnull public String getBranch()
      Returns:
      the branch on which the edit operation would happen
    • getContent

      @Nonnull public InputSupplier<InputStream> getContent()
      Returns:
      a supplier providing access to the file content
    • getMessage

      @Nonnull public Optional<String> getMessage()
      Returns:
      the commit message
    • getPath

      @Nonnull public String getPath()
      Returns:
      the file path
    • getRepository

      @Nonnull public Repository getRepository()
      Returns:
      the repository in which the edit operation would be executed
    • getSourceBranch

      @Nonnull public String getSourceBranch()
      Returns:
      the name of the branch that should serve as the start point for the edit operation
      Since:
      5.2
    • getSourceCommitId

      @Nonnull public Optional<String> getSourceCommitId()
      Returns:
      the commit ID of the existing file in the repository, or Optional#empty if this is a new file