Package ai.djl.repository
Class Artifact.Item
- java.lang.Object
-
- ai.djl.repository.Artifact.Item
-
-
Constructor Summary
Constructors Constructor Description Item()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Artifact
getArtifact()
Returns the artifact associated with this item.java.lang.String
getExtension()
Returns the type of file extension.java.lang.String
getName()
Returns the item name.java.lang.String
getSha1Hash()
Returns the hash of the item.long
getSize()
Returns the file size.java.lang.String
getType()
Sets the type of the item.java.lang.String
getUri()
Returns the URI of the item.void
setArtifact(Artifact artifact)
Sets the artifact associated with this item.void
setExtension(java.lang.String extension)
Sets the file extension.void
setName(java.lang.String name)
Sets the item name.void
setSha1Hash(java.lang.String sha1Hash)
Sets the sha1hash of the item.void
setSize(long size)
Sets the file size.void
setType(java.lang.String type)
Sets the type of the item.void
setUri(java.lang.String uri)
Sets the URI of the item.
-
-
-
Method Detail
-
getUri
public java.lang.String getUri()
Returns the URI of the item.- Returns:
- the URI of the item
-
setUri
public void setUri(java.lang.String uri)
Sets the URI of the item.- Parameters:
uri
- the new URI
-
getSha1Hash
public java.lang.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(java.lang.String sha1Hash)
Sets the sha1hash of the item.- Parameters:
sha1Hash
- the new hash
-
getType
public java.lang.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(java.lang.String type)
Sets the type of the item.- Parameters:
type
- the type- See Also:
getType()
-
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 java.lang.String getName()
Returns the item name.- Returns:
- the item name
-
setName
public void setName(java.lang.String name)
Sets the item name.- Parameters:
name
- the new name
-
getExtension
public java.lang.String getExtension()
Returns the type of file extension.- Returns:
- the type as "zip", "gzip", or "" for other
-
setExtension
public void setExtension(java.lang.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
-
-