Class GHContentBuilder

java.lang.Object
org.kohsuke.github.GHContentBuilder

public final class GHContentBuilder extends Object
Used to create/update content.

Call various methods to build up parameters, then call commit() to make the change effective.

Author:
Kohsuke Kawaguchi
See Also:
  • Method Details

    • author

      public GHContentBuilder 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:
      the gh content builder
    • author

      @Deprecated public GHContentBuilder 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:
      the gh content builder
    • author

      public GHContentBuilder 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:
      the gh content builder
    • branch

      public GHContentBuilder branch(String branch)
      Branch gh content builder.
      Parameters:
      branch - the branch
      Returns:
      the gh content builder
    • commit

      public GHContentUpdateResponse commit() throws IOException
      Commits a new content.
      Returns:
      the gh content update response
      Throws:
      IOException - the io exception
    • committer

      public GHContentBuilder 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:
      the gh content builder
    • committer

      @Deprecated public GHContentBuilder 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:
      the gh content builder
    • committer

      public GHContentBuilder 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:
      the gh content builder
    • content

      public GHContentBuilder content(String content)
      Content gh content builder.
      Parameters:
      content - the content
      Returns:
      the gh content builder
    • content

      public GHContentBuilder content(byte[] content)
      Content gh content builder.
      Parameters:
      content - the content
      Returns:
      the gh content builder
    • message

      public GHContentBuilder message(String commitMessage)
      Message gh content builder.
      Parameters:
      commitMessage - the commit message
      Returns:
      the gh content builder
    • path

      public GHContentBuilder path(String path)
      Path gh content builder.
      Parameters:
      path - the path
      Returns:
      the gh content builder
    • sha

      public GHContentBuilder sha(String sha)
      Used when updating (but not creating a new content) to specify the blob SHA of the file being replaced.
      Parameters:
      sha - the sha
      Returns:
      the gh content builder