Package ai.djl.repository
Class Artifact.Item
java.lang.Object
ai.djl.repository.Artifact.Item
- Enclosing class:
- Artifact
A file (possibly compressed) within an
Artifact.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the artifact associated with this item.Returns the type of file extension.getName()Returns the item name.Returns the hash of the item.longgetSize()Returns the file size.getType()Sets the type of the item.getUri()Returns the URI of the item.voidsetArtifact(Artifact artifact) Sets the artifact associated with this item.voidsetExtension(String extension) Sets the file extension.voidSets the item name.voidsetSha1Hash(String sha1Hash) Sets the sha1hash of the item.voidsetSize(long size) Sets the file size.voidSets the type of the item.voidSets the URI of the item.
-
Constructor Details
-
Item
public Item()
-
-
Method Details
-
getUri
Returns the URI of the item.- Returns:
- the URI of the item
-
setUri
Sets the URI of the item.- Parameters:
uri- the new URI
-
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
Sets the sha1hash of the item.- Parameters:
sha1Hash- the new hash
-
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
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
Returns the item name.- Returns:
- the item name
-
setName
Sets the item name.- Parameters:
name- the new name
-
getExtension
Returns the type of file extension.- Returns:
- the type as "zip", "gzip", or "" for other
-
setExtension
Sets the file extension.- Parameters:
extension- the new extension
-
getArtifact
Returns the artifact associated with this item.- Returns:
- the artifact
-
setArtifact
Sets the artifact associated with this item.- Parameters:
artifact- the new artifact
-