Class GithubAsset


  • public class GithubAsset
    extends java.lang.Object
    • Method Detail

      • of

        protected static GithubAsset of​(@NotNull
                                        @NotNull GithubRelease source,
                                        @NotNull
                                        @NotNull org.json.JSONObject contents)
      • getSource

        @NotNull
        protected @NotNull GithubRelease getSource()
      • getContents

        @NotNull
        protected @NotNull org.json.JSONObject getContents()
      • getID

        public int getID()
      • getURL

        @NotNull
        public @NotNull java.lang.String getURL()
      • getBrowserDownloadURL

        @NotNull
        public @NotNull java.lang.String getBrowserDownloadURL()
      • getNodeID

        @NotNull
        public @NotNull java.lang.String getNodeID()
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
      • getLabel

        @NotNull
        public @NotNull java.lang.String getLabel()
      • getState

        @NotNull
        public @NotNull java.lang.String getState()
      • getContentType

        @NotNull
        public @NotNull java.lang.String getContentType()
      • getSize

        public int getSize()
      • getDownloadCount

        public int getDownloadCount()
      • getCreateTime

        @Nullable
        public @Nullable java.util.Date getCreateTime()
      • getUpdateTime

        @Nullable
        public @Nullable java.util.Date getUpdateTime()
      • download

        public java.io.File download​(@NotNull
                                     @NotNull java.nio.file.CopyOption... options)
                              throws java.io.IOException
        Download this asset to current path with original name.
        Parameters:
        options - Copy options e.g. StandardCopyOption
        Returns:
        Downloaded file.
        Throws:
        java.io.IOException - Throws when has any io exception
      • download

        public java.io.File download​(@NotNull
                                     @NotNull java.lang.String path,
                                     @NotNull
                                     @NotNull java.nio.file.CopyOption... options)
                              throws java.io.IOException
        Download this asset with provided path and name.
        Parameters:
        path - target path with file suffix , e.g. "cache/build.zip"
        options - Copy options e.g. StandardCopyOption
        Returns:
        Downloaded file.
        Throws:
        java.io.IOException - Throws when has any io exception
      • getUploader

        public GithubUser getUploader()
        Get the uploader of this asset.
        Returns:
        The author user GithubUser
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object