Package ai.djl.repository
Class LocalRepository
- java.lang.Object
-
- ai.djl.repository.AbstractRepository
-
- ai.djl.repository.LocalRepository
-
- All Implemented Interfaces:
Repository
public class LocalRepository extends AbstractRepository
ALocalRepository
is aRepository
located in a filesystem directory.- See Also:
Repository
-
-
Field Summary
-
Fields inherited from class ai.djl.repository.AbstractRepository
arguments, name, uri
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LocalRepository(java.lang.String name, java.net.URI uri, java.nio.file.Path path)
(Internal) Constructs aLocalRepository
from the path with inferred name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MRL>
getResources()
Returns a list ofMRL
s in the repository.boolean
isRemote()
Returns whether the repository is remote repository.Metadata
locate(MRL mrl)
Returns the metadata at a mrl.Artifact
resolve(MRL mrl, java.util.Map<java.lang.String,java.lang.String> filter)
Returns the artifact matching a mrl, version, and property filter.-
Methods inherited from class ai.djl.repository.AbstractRepository
addResource, download, getBaseUri, getCacheDirectory, getFile, getName, listDirectory, openStream, prepare, resolvePath, save
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.djl.repository.Repository
dataset, dataset, getResourceDirectory, model, model, model, prepare
-
-
-
-
Constructor Detail
-
LocalRepository
protected LocalRepository(java.lang.String name, java.net.URI uri, java.nio.file.Path path)
(Internal) Constructs aLocalRepository
from the path with inferred name.- Parameters:
name
- the name of the repositoryuri
- the base URI of the repositorypath
- the path to the repository
-
-
Method Detail
-
isRemote
public boolean isRemote()
Returns whether the repository is remote repository.- Returns:
- whether the repository is remote repository
-
locate
public Metadata locate(MRL mrl) throws java.io.IOException
Returns the metadata at a mrl.- Parameters:
mrl
- the mrl of the metadata to retrieve- Returns:
- the metadata
- Throws:
java.io.IOException
- if it failed to load the metadata
-
resolve
public Artifact resolve(MRL mrl, java.util.Map<java.lang.String,java.lang.String> filter) throws java.io.IOException
Returns the artifact matching a mrl, version, and property filter.- Parameters:
mrl
- the mrl to match the artifact againstfilter
- the property filter- Returns:
- the matched artifact
- Throws:
java.io.IOException
- if it failed to load the artifact
-
-