Class GHContentUpdater

java.lang.Object
org.kohsuke.github.GHContentUpdater

public final class GHContentUpdater extends Object
Builder for updating existing repository content with support for specifying author and committer information.

Obtain an instance via GHContent.createUpdate().

See Also:
  • Method Details

    • author

      public GHContentUpdater author(String name, String email)
      Configures the author of the commit. If not specified, the authenticated user is used as the author.
      Parameters:
      name - the name of the author
      email - the email of the author
      Returns:
      this updater
    • author

      @Deprecated public GHContentUpdater author(String name, String email, Date date)
      Deprecated.
      Configures the author of the commit. If not specified, the authenticated user is used as the author.
      Parameters:
      name - the name of the author
      email - the email of the author
      date - the date of the authoring
      Returns:
      this updater
    • author

      public GHContentUpdater author(String name, String email, Instant date)
      Configures the author of the commit. If not specified, the authenticated user is used as the author.
      Parameters:
      name - the name of the author
      email - the email of the author
      date - the timestamp for the authoring
      Returns:
      this updater
    • branch

      public GHContentUpdater branch(String branch)
      Sets the branch to update the content on.
      Parameters:
      branch - the branch name
      Returns:
      this updater
    • commit

      public GHContentUpdateResponse commit() throws IOException
      Commits the update.
      Returns:
      the response containing the updated content and commit information
      Throws:
      IOException - the io exception
    • committer

      public GHContentUpdater committer(String name, String email)
      Configures the committer of the commit. If not specified, the authenticated user is used as the committer.
      Parameters:
      name - the name of the committer
      email - the email of the committer
      Returns:
      this updater
    • committer

      @Deprecated public GHContentUpdater committer(String name, String email, Date date)
      Deprecated.
      Configures the committer of the commit. If not specified, the authenticated user is used as the committer.
      Parameters:
      name - the name of the committer
      email - the email of the committer
      date - the date of the commit
      Returns:
      this updater
    • committer

      public GHContentUpdater committer(String name, String email, Instant date)
      Configures the committer of the commit. If not specified, the authenticated user is used as the committer.
      Parameters:
      name - the name of the committer
      email - the email of the committer
      date - the timestamp of the commit
      Returns:
      this updater
    • content

      public GHContentUpdater content(String newContent)
      Sets the new file content as a string.
      Parameters:
      newContent - the new content
      Returns:
      this updater
    • content

      public GHContentUpdater content(byte[] newContent)
      Sets the new file content as raw bytes.
      Parameters:
      newContent - the new content bytes
      Returns:
      this updater
    • message

      public GHContentUpdater message(String message)
      Sets the commit message.
      Parameters:
      message - the commit message
      Returns:
      this updater