Package org.nd4j.common.resources
Interface Resolver
-
- All Known Implementing Classes:
StrumpfResolver
public interface Resolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileasFile(String resourcePath)Get the specified resources as a standard local file.InputStreamasStream(String resourcePath)Get the specified resources as an input stream.voidcopyDirectory(String dirPath, File destinationDir)Copy the directory resource (recursively) to the specified destination directorybooleandirectoryExists(String dirPath)Determine if the specified directory resource can be resolved bycopyDirectory(String, File)booleanexists(String resourcePath)Determine if the specified file resource can be resolved byasFile(String)andasStream(String)booleanhasLocalCache()FilelocalCacheRoot()StringnormalizePath(String path)Normalize the path that may be a resource reference.intpriority()Priority of this resolver.
-
-
-
Method Detail
-
priority
int priority()
Priority of this resolver. 0 is highest priority (check first), larger values are lower priority (check last)
-
exists
boolean exists(String resourcePath)
Determine if the specified file resource can be resolved byasFile(String)andasStream(String)- Parameters:
resourcePath- Path of the resource to be resolved- Returns:
- True if this resolver is able to resolve the resource file - i.e., whether it is a valid path and exists
-
directoryExists
boolean directoryExists(String dirPath)
Determine if the specified directory resource can be resolved bycopyDirectory(String, File)- Parameters:
dirPath- Path of the directory resource to be resolved- Returns:
- True if this resolver is able to resolve the directory - i.e., whether it is a valid path and exists
-
asFile
File asFile(String resourcePath)
Get the specified resources as a standard local file. Note that the resource must exist as determined byexists(String)- Parameters:
resourcePath- Path of the resource.- Returns:
- The local file version of the resource
-
asStream
InputStream asStream(String resourcePath)
Get the specified resources as an input stream. Note that the resource must exist as determined byexists(String)- Parameters:
resourcePath- Path of the resource.- Returns:
- The resource as an input stream
-
copyDirectory
void copyDirectory(String dirPath, File destinationDir)
Copy the directory resource (recursively) to the specified destination directory- Parameters:
dirPath- Path of the resource directory to resolvedestinationDir- Where the files should be copied to
-
hasLocalCache
boolean hasLocalCache()
- Returns:
- True if the resolver has a local cache directory, as returned by
localCacheRoot()
-
localCacheRoot
File localCacheRoot()
- Returns:
- Root directory of the local cache, or null if
hasLocalCache()returns false
-
-