Package ai.djl.repository
Class SimpleRepository
java.lang.Object
ai.djl.repository.AbstractRepository
ai.djl.repository.SimpleRepository
- All Implemented Interfaces:
- Repository
A 
SimpleRepository is a Repository containing only a single artifact without
 requiring a "metadata.json" file.- See Also:
- 
Field SummaryFields inherited from class ai.djl.repository.AbstractRepositoryarguments, name, uri
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedSimpleRepository(String name, URI uri, Path path) (Internal) Constructs a SimpleRepository.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddownload(Path tmp, URI baseUri, Artifact.Item item, ai.djl.util.Progress progress) Returns the URI to the base of the repository.Returns the cache directory for the repository.getResourceDirectory(Artifact artifact) Returns the resource directory for the an artifact.Returns a list ofMRLs in the repository.booleanisRemote()Returns whether the repository is remote repository.Returns the metadata at a mrl.voidPrepares the artifact for use with progress tracking.Returns the artifact matching a mrl, version, and property filter.protected URIresolvePath(Artifact.Item item, String path) Methods inherited from class ai.djl.repository.AbstractRepositoryaddResource, getFile, getName, listDirectory, openStream, save
- 
Constructor Details- 
SimpleRepository(Internal) Constructs a SimpleRepository.- Parameters:
- name- the name of the repository
- uri- the base URI of the repository
- path- the path to the repository
 
 
- 
- 
Method Details- 
isRemotepublic boolean isRemote()Returns whether the repository is remote repository.- Returns:
- whether the repository is remote repository
 
- 
getBaseUriReturns the URI to the base of the repository.- Specified by:
- getBaseUriin interface- Repository
- Overrides:
- getBaseUriin class- AbstractRepository
- Returns:
- the URI
 
- 
locateReturns 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
 
- 
resolveReturns the artifact matching a mrl, version, and property filter.- Parameters:
- mrl- the mrl to match the artifact against
- filter- the property filter
- Returns:
- the matched artifact
- Throws:
- IOException- if it failed to load the artifact
 
- 
getResourceDirectoryReturns the resource directory for the an artifact.- Parameters:
- artifact- the artifact whose resource directory to return
- Returns:
- the resource directory path
- Throws:
- IOException- if it failed to ensure the creation of the cache directory
 
- 
downloadprotected void download(Path tmp, URI baseUri, Artifact.Item item, ai.djl.util.Progress progress) throws IOException - Overrides:
- downloadin class- AbstractRepository
- Throws:
- IOException
 
- 
preparePrepares the artifact for use with progress tracking.- Specified by:
- preparein interface- Repository
- Overrides:
- preparein class- AbstractRepository
- Parameters:
- artifact- the artifact to prepare
- progress- the progress tracker
- Throws:
- IOException- if it failed to prepare
 
- 
getCacheDirectoryReturns the cache directory for the repository.- Specified by:
- getCacheDirectoryin interface- Repository
- Overrides:
- getCacheDirectoryin class- AbstractRepository
- Returns:
- the cache directory path
- Throws:
- IOException- if it failed to ensure the creation of the cache directory
 
- 
resolvePath- Overrides:
- resolvePathin class- AbstractRepository
- Throws:
- IOException
 
- 
getResourcesReturns 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
 
 
-