public class Resource
extends java.lang.Object
Repository
.Constructor and Description |
---|
Resource(Repository repository,
MRL mrl,
java.lang.String version)
Constructs a
Resource instance. |
Modifier and Type | Method and Description |
---|---|
Artifact |
getDefaultArtifact()
Returns the default artifact.
|
MRL |
getMrl()
Returns the
MRL of the resource. |
Repository |
getRepository()
Returns the
Repository of the resource. |
java.lang.String |
getVersion()
Returns the version of the resource.
|
java.util.List<Artifact> |
listArtifacts()
Returns a list of artifacts in this resource.
|
Artifact |
match(java.util.Map<java.lang.String,java.lang.String> criteria)
Returns the first artifact that matches a given criteria.
|
void |
prepare(Artifact artifact)
Prepares the artifact for use.
|
void |
prepare(Artifact artifact,
ai.djl.util.Progress progress)
Prepares the artifact for use with progress tracking.
|
public Resource(Repository repository, MRL mrl, java.lang.String version)
Resource
instance.repository
- the Repository
mrl
- the resource locatorversion
- the version of the resourcepublic Repository getRepository()
Repository
of the resource.Repository
of the resourcepublic java.lang.String getVersion()
public Artifact getDefaultArtifact() throws java.io.IOException
java.io.IOException
- for various exceptions depending on the specific datasetpublic Artifact match(java.util.Map<java.lang.String,java.lang.String> criteria) throws java.io.IOException
criteria
- the criteria to match againstjava.io.IOException
- for errors while loading the modelpublic java.util.List<Artifact> listArtifacts() throws java.io.IOException
java.io.IOException
- for errors while loading the modelpublic void prepare(Artifact artifact) throws java.io.IOException
artifact
- the artifact to preparejava.io.IOException
- if it failed to preparepublic void prepare(Artifact artifact, ai.djl.util.Progress progress) throws java.io.IOException
artifact
- the artifact to prepareprogress
- the progress trackerjava.io.IOException
- if it failed to prepare