Class GHRelease

java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHRelease

public class GHRelease extends GHObject
Release in a github repository.
See Also:
  • Constructor Details

    • GHRelease

      public GHRelease()
  • Method Details

    • getDiscussionUrl

      public String getDiscussionUrl()
      Gets discussion url. Only present if a discussion relating to the release exists
      Returns:
      the discussion url
    • 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

      @Deprecated public GHRelease setDraft(boolean draft) throws IOException
      Deprecated.
      Sets draft.
      Parameters:
      draft - the draft
      Returns:
      the draft
      Throws:
      IOException - the io exception
    • getHtmlUrl

      public URL getHtmlUrl()
      Gets the html url.
      Specified by:
      getHtmlUrl in class GHObject
      Returns:
      the html url
    • 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

      @Deprecated public void setOwner(GHRepository owner)
      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

      public Date getPublished_at()
      Gets published at.
      Returns:
      the published at
    • 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 file
      contentType - 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 filename
      stream - the stream
      contentType - the content type
      Returns:
      the gh asset
      Throws:
      IOException - the io exception
    • assets

      @Deprecated public List<GHAsset> assets()
      Deprecated.
      This should be the default behavior of getAssets() 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 public List<GHAsset> getAssets() throws IOException
      Deprecated.
      The behavior of this method will change in a future release. It will then provide cached assets as provided by assets(). Use listAssets() 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

      public PagedIterable<GHAsset> listAssets() throws IOException
      Re-fetch the assets of this release.
      Returns:
      the assets
      Throws:
      IOException - the io exception
    • delete

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

      public GHReleaseUpdater update()
      Updates this release via a builder.
      Returns:
      the gh release updater
    • 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