Package cc.carm.lib.githubreleases4j
Class GithubAsset
- java.lang.Object
-
- cc.carm.lib.githubreleases4j.GithubAsset
-
public class GithubAsset extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Filedownload(@NotNull java.lang.String path, @NotNull java.nio.file.CopyOption... options)Download this asset with provided path and name.java.io.Filedownload(@NotNull java.nio.file.CopyOption... options)Download this asset to current path with original name.@NotNull java.lang.StringgetBrowserDownloadURL()protected @NotNull org.json.JSONObjectgetContents()@NotNull java.lang.StringgetContentType()@Nullable java.util.DategetCreateTime()intgetDownloadCount()intgetID()@NotNull java.lang.StringgetLabel()@NotNull java.lang.StringgetName()@NotNull java.lang.StringgetNodeID()intgetSize()protected @NotNull GithubReleasegetSource()@NotNull java.lang.StringgetState()@Nullable java.util.DategetUpdateTime()GithubUsergetUploader()Get the uploader of this asset.@NotNull java.lang.StringgetURL()protected static GithubAssetof(@NotNull GithubRelease source, @NotNull org.json.JSONObject contents)java.lang.StringtoString()
-
-
-
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.IOExceptionDownload 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.IOExceptionDownload 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:
toStringin classjava.lang.Object
-
-