Package ai.djl.repository
Class RemoteRepository
java.lang.Object
ai.djl.repository.AbstractRepository
ai.djl.repository.RemoteRepository
- All Implemented Interfaces:
Repository
A
RemoteRepository is a Repository located on a remote web server.- See Also:
-
Field Summary
Fields inherited from class ai.djl.repository.AbstractRepository
arguments, name, uri -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRemoteRepository(String name, URI uri) (Internal) Constructs a remote repository. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResource(MRL mrl) Adds resource to the repository.Returns a list ofMRLs in the repository.booleanisRemote()Returns whether the repository is remote repository.Returns the metadata at a mrl.Returns the artifact matching a mrl, version, and property filter.Methods inherited from class ai.djl.repository.AbstractRepository
download, getBaseUri, getCacheDirectory, getFile, getName, listDirectory, openStream, prepare, resolvePath, saveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.repository.Repository
dataset, dataset, getResourceDirectory, model, model, model, prepare
-
Constructor Details
-
RemoteRepository
(Internal) Constructs a remote repository.- Parameters:
name- the repository nameuri- the repository location
-
-
Method Details
-
isRemote
public boolean isRemote()Returns whether the repository is remote repository.- Returns:
- whether the repository is remote repository
-
locate
Returns the metadata at a mrl.- Parameters:
mrl- the mrl of the metadata to retrieve- Returns:
- the metadata
- Throws:
IOException- if it failed to load the metadata
-
resolve
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:
IOException- if it failed to load the artifact
-
getResources
Returns a list ofMRLs in the repository.An empty list will be returned if underlying
Repositoryimplementation does not support this feature.- Returns:
- a list of
MRLs in the repository
-
addResource
Adds resource to the repository.- Specified by:
addResourcein interfaceRepository- Overrides:
addResourcein classAbstractRepository- Parameters:
mrl- the resource to add
-