Package org.kohsuke.github
Class GHGist
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHGist
-
public class GHGist extends GHObject
Gist.- Author:
- Kohsuke Kawaguchi
- See Also:
GHUser#listGists()
,GitHub#getGist(String)
,GitHub#createGist()
, documentation
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
delete()
Deletes this gist.boolean
equals(Object o)
Equals.GHGist
fork()
Forks this gist into your own.int
getCommentCount()
Gets comment count.String
getCommentsUrl()
Gets comments url.String
getCommitsUrl()
Gets commits url.String
getDescription()
Gets description.GHGistFile
getFile(String name)
Gets file.Map<String,GHGistFile>
getFiles()
Gets files.String
getForksUrl()
Gets forks url.String
getGistId()
Gets the id for this Gist.String
getGitPullUrl()
Gets git pull url.String
getGitPushUrl()
Gets git push url.URL
getHtmlUrl()
Get the html url.long
getId()
Deprecated.UsegetGistId()
instead.GHUser
getOwner()
Gets owner.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.int
hashCode()
Hash code.boolean
isPublic()
Is public boolean.boolean
isStarred()
Is starred boolean.PagedIterable<GHGist>
listForks()
List forks paged iterable.void
star()
Star.void
unstar()
Unstar.GHGistUpdater
update()
Updates this gist via a builder.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
getId
@Deprecated public long getId()
Deprecated.UsegetGistId()
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 runtimeNumberFormatException
.
-
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 ofgetId()
.- 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 classGHObject
- 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.
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-