Package org.kohsuke.github
Class GHRelease
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassets()Deprecated.voiddelete()Deletes this release.Deprecated.The behavior of this method will change in a future release.Gets assets url.getBody()Gets body.Gets discussion url.Gets the html url.getName()Gets name.getOwner()Gets owner.Gets published at.getRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Gets tag name.Gets tarball url.Gets target commitish.Gets upload url.Gets zipball url.booleanisDraft()Is draft boolean.booleanIs prerelease boolean.Re-fetch the assets of this release.setDraft(boolean draft) Deprecated.Useupdate()voidSets name.voidsetOwner(GHRepository owner) Deprecated.Do not use this method.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
-
setDraft
Deprecated.Useupdate()Sets draft.- Parameters:
draft- the draft- Returns:
- the draft
- Throws:
IOException- the io exception
-
getHtmlUrl
Gets the html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- the html url
-
getName
Gets name.- Returns:
- the name
-
setName
Sets name.- Parameters:
name- the name
-
getOwner
Gets owner.- Returns:
- the owner
-
setOwner
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets owner.- Parameters:
owner- 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
-
assets
Deprecated.This should be the default behavior ofgetAssets()in a future release. This method is introduced in addition to enable a transition to using cached asset information while keeping the existing logic in place for backwards compatibility.Get the cached assets.- Returns:
- the assets
-
getAssets
Deprecated.The behavior of this method will change in a future release. It will then provide cached assets as provided byassets(). UselistAssets()instead to fetch up-to-date information of assets.Re-fetch the assets of this release.- Returns:
- the assets
- Throws:
IOException- the io exception
-
listAssets
Re-fetch the assets of this release.- Returns:
- the assets
- Throws:
IOException- the io exception
-
delete
Deletes this release.- Throws:
IOException- the io exception
-
update
Updates this release via a builder.- Returns:
- the gh release updater
-
getRoot
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
getAssets()in a future release.