Class GHGist


public class GHGist extends GHObject
Gist.
Author:
Kohsuke Kawaguchi
See Also:
  • Method Details

    • getId

      @Deprecated public long getId()
      Deprecated.
      Use getGistId() instead.
      Unlike most other GitHub objects, the id for Gists can be non-numeric, such as "aa5a315d61ae9438b18d". If the id is numeric, this method will get it. If id is not numeric, this will throw a runtime NumberFormatException.
      Overrides:
      getId in class GHObject
      Returns:
      id of the Gist.
    • getGistId

      public String getGistId()
      Gets the id for this Gist. Unlike most other GitHub objects, the id for Gists can be non-numeric, such as "aa5a315d61ae9438b18d". This should be used instead of getId().
      Returns:
      id of this Gist
    • getOwner

      public GHUser getOwner() throws IOException
      Gets owner.
      Returns:
      User that owns this Gist.
      Throws:
      IOException - the io exception
    • getForksUrl

      public String getForksUrl()
      Gets forks url.
      Returns:
      the forks url
    • getCommitsUrl

      public String getCommitsUrl()
      Gets commits url.
      Returns:
      the commits url
    • getGitPullUrl

      public String getGitPullUrl()
      Gets git pull url.
      Returns:
      URL like https://gist.github.com/gists/12345.git
    • getGitPushUrl

      public String getGitPushUrl()
      Gets git push url.
      Returns:
      the git push url
    • getHtmlUrl

      public URL getHtmlUrl()
      Get the html url.
      Specified by:
      getHtmlUrl in class GHObject
      Returns:
      the github html url
    • isPublic

      public boolean isPublic()
      Is public boolean.
      Returns:
      the boolean
    • getDescription

      public String getDescription()
      Gets description.
      Returns:
      the description
    • getCommentCount

      public int getCommentCount()
      Gets comment count.
      Returns:
      the comment count
    • getCommentsUrl

      public String getCommentsUrl()
      Gets comments url.
      Returns:
      API URL of listing comments.
    • getFile

      public GHGistFile getFile(String name)
      Gets file.
      Parameters:
      name - the name
      Returns:
      the file
    • getFiles

      public Map<String,GHGistFile> getFiles()
      Gets files.
      Returns:
      the files
    • star

      public void star() throws IOException
      Star.
      Throws:
      IOException - the io exception
    • unstar

      public void unstar() throws IOException
      Unstar.
      Throws:
      IOException - the io exception
    • isStarred

      public boolean isStarred() throws IOException
      Is starred boolean.
      Returns:
      the boolean
      Throws:
      IOException - the io exception
    • fork

      public GHGist fork() throws IOException
      Forks this gist into your own.
      Returns:
      the gh gist
      Throws:
      IOException - the io exception
    • listForks

      public PagedIterable<GHGist> listForks()
      List forks paged iterable.
      Returns:
      the paged iterable
    • delete

      public void delete() throws IOException
      Deletes this gist.
      Throws:
      IOException - the io exception
    • update

      public GHGistUpdater update() throws IOException
      Updates this gist via a builder.
      Returns:
      the gh gist updater
      Throws:
      IOException - the io exception
    • equals

      public boolean equals(Object o)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      o - the o
      Returns:
      true, if successful
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • getRoot

      @Deprecated public GitHub getRoot()
      Deprecated.
      For access to the GitHub instance, use a local copy instead of pulling it out of objects.
      Get the root GitHub instance for this object.
      Returns:
      the root GitHub instance