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.File
download(@NotNull java.lang.String path, @NotNull java.nio.file.CopyOption... options)
Download this asset with provided path and name.java.io.File
download(@NotNull java.nio.file.CopyOption... options)
Download this asset to current path with original name.@NotNull java.lang.String
getBrowserDownloadURL()
protected @NotNull org.json.JSONObject
getContents()
@NotNull java.lang.String
getContentType()
@Nullable java.util.Date
getCreateTime()
int
getDownloadCount()
int
getID()
@NotNull java.lang.String
getLabel()
@NotNull java.lang.String
getName()
@NotNull java.lang.String
getNodeID()
int
getSize()
protected @NotNull GithubRelease
getSource()
@NotNull java.lang.String
getState()
@Nullable java.util.Date
getUpdateTime()
GithubUser
getUploader()
Get the uploader of this asset.@NotNull java.lang.String
getURL()
protected static GithubAsset
of(@NotNull GithubRelease source, @NotNull org.json.JSONObject contents)
java.lang.String
toString()
-
-
-
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 classjava.lang.Object
-
-