java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHRelease
Release in a github repository.
-
Field Summary
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Deletes this release.Get the cached assets.Gets assets url.getBody()
Gets body.Gets discussion url.Gets the html url.getName()
Gets name.getOwner()
Gets owner.Gets published at.Gets tag name.Gets tarball url.Gets target commitish.Gets upload url.Gets zipball url.boolean
isDraft()
Is draft boolean.boolean
Is prerelease boolean.Re-fetch the assets of this release.void
Sets name.update()
Updates this release via a builder.uploadAsset
(File file, String contentType) Because github relies on SNI (http://en.wikipedia.org/wiki/Server_Name_Indication) this method will only work on Java 7 or greater.uploadAsset
(String filename, InputStream stream, String contentType) Upload asset gh asset.Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
Constructor Details
-
GHRelease
public GHRelease()Create default GHRelease instance
-
-
Method Details
-
getDiscussionUrl
Gets discussion url. Only present if a discussion relating to the release exists- Returns:
- the discussion url
-
getAssetsUrl
Gets assets url.- Returns:
- the assets url
-
getBody
Gets body.- Returns:
- the body
-
isDraft
public boolean isDraft()Is draft boolean.- Returns:
- the boolean
-
getHtmlUrl
Gets the html url.- Returns:
- the html url
-
getName
Gets name.- Returns:
- the name
-
setName
Sets name.- Parameters:
name
- the name
-
getOwner
Gets owner.- Returns:
- the owner
-
isPrerelease
public boolean isPrerelease()Is prerelease boolean.- Returns:
- the boolean
-
getPublished_at
Gets published at.- Returns:
- the published at
-
getTagName
Gets tag name.- Returns:
- the tag name
-
getTargetCommitish
Gets target commitish.- Returns:
- the target commitish
-
getUploadUrl
Gets upload url.- Returns:
- the upload url
-
getZipballUrl
Gets zipball url.- Returns:
- the zipball url
-
getTarballUrl
Gets tarball url.- Returns:
- the tarball url
-
uploadAsset
Because github relies on SNI (http://en.wikipedia.org/wiki/Server_Name_Indication) this method will only work on Java 7 or greater. Options for fixing this for earlier JVMs can be found here http://stackoverflow.com/questions/12361090/server-name-indication-sni-on-java but involve more complicated handling of the HTTP requests to github's API.- Parameters:
file
- the filecontentType
- the content type- Returns:
- the gh asset
- Throws:
IOException
- the io exception
-
uploadAsset
public GHAsset uploadAsset(String filename, InputStream stream, String contentType) throws IOException Upload asset gh asset.- Parameters:
filename
- the filenamestream
- the streamcontentType
- the content type- Returns:
- the gh asset
- Throws:
IOException
- the io exception
-
getAssets
Get the cached assets.- Returns:
- the assets
-
listAssets
Re-fetch the assets of this release.- Returns:
- the assets iterable
-
delete
Deletes this release.- Throws:
IOException
- the io exception
-
update
Updates this release via a builder.- Returns:
- the gh release updater
-