Class Artifact.Item

java.lang.Object
ai.djl.repository.Artifact.Item
Enclosing class:
Artifact

public static final class Artifact.Item extends Object
A file (possibly compressed) within an Artifact.
  • Constructor Details

    • Item

      public Item()
  • Method Details

    • getUri

      public String getUri()
      Returns the URI of the item.
      Returns:
      the URI of the item
    • setUri

      public void setUri(String uri)
      Sets the URI of the item.
      Parameters:
      uri - the new URI
    • getSha1Hash

      public String getSha1Hash()
      Returns the hash of the item.

      This value is from the metadata, but should be checked when the item is downloaded.

      Returns:
      the sha1 hash
    • setSha1Hash

      public void setSha1Hash(String sha1Hash)
      Sets the sha1hash of the item.
      Parameters:
      sha1Hash - the new hash
    • getType

      public String getType()
      Sets the type of the item.

      The valid types are:

      • "file" - used for single files and gzip compressed files
      • "dir" - used for extracted zip folders
      Returns:
      the type string
    • setType

      public void setType(String type)
      Sets the type of the item.
      Parameters:
      type - the type
      See Also:
    • getSize

      public long getSize()
      Returns the file size.
      Returns:
      the file size in bytes
    • setSize

      public void setSize(long size)
      Sets the file size.
      Parameters:
      size - the new size in bytes
    • getName

      public String getName()
      Returns the item name.
      Returns:
      the item name
    • setName

      public void setName(String name)
      Sets the item name.
      Parameters:
      name - the new name
    • getExtension

      public String getExtension()
      Returns the type of file extension.
      Returns:
      the type as "zip", "gzip", or "" for other
    • setExtension

      public void setExtension(String extension)
      Sets the file extension.
      Parameters:
      extension - the new extension
    • getArtifact

      public Artifact getArtifact()
      Returns the artifact associated with this item.
      Returns:
      the artifact
    • setArtifact

      public void setArtifact(Artifact artifact)
      Sets the artifact associated with this item.
      Parameters:
      artifact - the new artifact