Package org.kohsuke.github
Class GHRelease
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHRelease
-
public class GHRelease extends GHObject
Release in a github repository.
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
created_at, id, responseHeaderFields, updated_at, url
-
-
Constructor Summary
Constructors Constructor Description GHRelease()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete()Deletes this release.List<GHAsset>getAssets()Gets assets.StringgetAssetsUrl()Gets assets url.StringgetBody()Gets body.URLgetHtmlUrl()Gets html url.StringgetName()Gets name.GHRepositorygetOwner()Gets owner.DategetPublished_at()Gets published at.GitHubgetRoot()Gets root.StringgetTagName()Gets tag name.StringgetTarballUrl()Gets tarball url.StringgetTargetCommitish()Gets target commitish.StringgetUploadUrl()Gets upload url.StringgetZipballUrl()Gets zipball url.booleanisDraft()Is draft boolean.booleanisPrerelease()Is prerelease boolean.GHReleasesetDraft(boolean draft)Deprecated.Useupdate()voidsetName(String name)Sets name.voidsetOwner(GHRepository owner)Sets owner.GHReleaseUpdaterupdate()Updates this release via a builder.GHAssetuploadAsset(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.GHAssetuploadAsset(String filename, InputStream stream, String contentType)Upload asset gh asset.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getResponseHeaderFields, getUpdatedAt, getUrl, toString
-
-
-
-
Method Detail
-
getAssetsUrl
public String getAssetsUrl()
Gets assets url.- Returns:
- the assets url
-
getBody
public String getBody()
Gets body.- Returns:
- the body
-
isDraft
public boolean isDraft()
Is draft boolean.- Returns:
- the boolean
-
setDraft
public GHRelease setDraft(boolean draft) throws IOException
Deprecated.Useupdate()Sets draft.- Parameters:
draft- the draft- Returns:
- the draft
- Throws:
IOException- the io exception
-
getHtmlUrl
public URL getHtmlUrl()
Description copied from class:GHObjectGets html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- URL of this object for humans, which renders some HTML.
-
getName
public String getName()
Gets name.- Returns:
- the name
-
setName
public void setName(String name)
Sets name.- Parameters:
name- the name
-
getOwner
public GHRepository getOwner()
Gets owner.- Returns:
- the owner
-
setOwner
public void setOwner(GHRepository owner)
Sets owner.- Parameters:
owner- the owner
-
isPrerelease
public boolean isPrerelease()
Is prerelease boolean.- Returns:
- the boolean
-
getPublished_at
public Date getPublished_at()
Gets published at.- Returns:
- the published at
-
getRoot
public GitHub getRoot()
Gets root.- Returns:
- the root
-
getTagName
public String getTagName()
Gets tag name.- Returns:
- the tag name
-
getTargetCommitish
public String getTargetCommitish()
Gets target commitish.- Returns:
- the target commitish
-
getUploadUrl
public String getUploadUrl()
Gets upload url.- Returns:
- the upload url
-
getZipballUrl
public String getZipballUrl()
Gets zipball url.- Returns:
- the zipball url
-
getTarballUrl
public String getTarballUrl()
Gets tarball url.- Returns:
- the tarball url
-
uploadAsset
public GHAsset uploadAsset(File file, String contentType) throws IOException
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
public List<GHAsset> getAssets() throws IOException
Gets assets.- Returns:
- the assets
- Throws:
IOException- the io exception
-
delete
public void delete() throws IOExceptionDeletes this release.- Throws:
IOException- the io exception
-
update
public GHReleaseUpdater update()
Updates this release via a builder.- Returns:
- the gh release updater
-
-