Package org.kohsuke.github
Class GHArtifact
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHArtifact
-
public class GHArtifact extends GHObject
An artifact from a workflow run.- Author:
- Guillaume Smet
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHArtifact()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete()Deletes the artifact.<T> Tdownload(InputStreamFunction<T> streamFunction)Downloads the artifact.URLgetArchiveDownloadUrl()Gets the archive download URL.DategetExpiresAt()Gets the date at which this artifact will expire.URLgetHtmlUrl()Deprecated.This object has no HTML URL.StringgetName()Gets the name.GHRepositorygetRepository()Repository to which the artifact belongs.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.longgetSizeInBytes()Gets the size of the artifact in bytes.booleanisExpired()If this artifact has expired.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
getName
public String getName()
Gets the name.- Returns:
- the name
-
getSizeInBytes
public long getSizeInBytes()
Gets the size of the artifact in bytes.- Returns:
- the size
-
getArchiveDownloadUrl
public URL getArchiveDownloadUrl()
Gets the archive download URL.- Returns:
- the archive download URL
-
isExpired
public boolean isExpired()
If this artifact has expired.- Returns:
- if the artifact has expired
-
getExpiresAt
public Date getExpiresAt()
Gets the date at which this artifact will expire.- Returns:
- the date of expiration
-
getRepository
public GHRepository getRepository()
Repository to which the artifact belongs.- Returns:
- the repository
-
getHtmlUrl
public URL getHtmlUrl() throws IOException
Deprecated.This object has no HTML URL.Gets the html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- the html url
- Throws:
IOException- Signals that an I/O exception has occurred.
-
delete
public void delete() throws IOExceptionDeletes the artifact.- Throws:
IOException- the io exception
-
download
public <T> T download(InputStreamFunction<T> streamFunction) throws IOException
Downloads the artifact.- Type Parameters:
T- the type of result- Parameters:
streamFunction- TheInputStreamFunctionthat will process the stream- Returns:
- the result of reading the stream.
- Throws:
IOException- The IO exception.
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-