Class GHArtifact


  • public class GHArtifact
    extends GHObject
    An artifact from a workflow run.
    Author:
    Guillaume Smet
    • Constructor Detail

      • GHArtifact

        public GHArtifact()
    • 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.
        Description copied from class: GHObject
        Gets html url.
        Specified by:
        getHtmlUrl in class GHObject
        Returns:
        URL of this object for humans, which renders some HTML.
        Throws:
        IOException - on error
      • delete

        public void delete()
                    throws IOException
        Deletes 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 - The InputStreamFunction that will process the stream
        Returns:
        the result of reading the stream.
        Throws:
        IOException - The IO exception.