public class StrumpfResolver extends java.lang.Object implements Resolver
REF) point to remote files, that will be downloaded,
decompressed and cached locally.DEFAULT_CACHE_DIR; this can be overridden by setting the ND4JSystemProperties#RESOURCES_CACHE_DIR
system property.ND4JSystemProperties.RESOURCES_LOCAL_DIRS| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
cacheDir |
static java.lang.String |
DEFAULT_CACHE_DIR |
protected java.util.List<java.lang.String> |
localResourceDirs |
static java.lang.String |
REF |
| Constructor and Description |
|---|
StrumpfResolver() |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
asFile(java.lang.String resourcePath)
Get the specified resources as a standard local file.
|
protected void |
assertExists(java.lang.String resourcePath) |
java.io.InputStream |
asStream(java.lang.String resourcePath)
Get the specified resources as an input stream.
|
void |
copyDirectory(java.lang.String dirPath,
java.io.File destinationDir)
Copy the directory resource (recursively) to the specified destination directory
|
boolean |
directoryExists(java.lang.String dirPath)
Determine if the specified directory resource can be resolved by
Resolver.copyDirectory(String, File) |
boolean |
exists(java.lang.String resourcePath)
Determine if the specified file resource can be resolved by
Resolver.asFile(String) and Resolver.asStream(String) |
boolean |
hasLocalCache() |
java.io.File |
localCacheRoot() |
int |
priority()
Priority of this resolver.
|
public static final java.lang.String DEFAULT_CACHE_DIR
public static final java.lang.String REF
protected final java.util.List<java.lang.String> localResourceDirs
protected final java.io.File cacheDir
public int priority()
Resolverpublic boolean exists(@NonNull
java.lang.String resourcePath)
ResolverResolver.asFile(String) and Resolver.asStream(String)public boolean directoryExists(java.lang.String dirPath)
ResolverResolver.copyDirectory(String, File)directoryExists in interface ResolverdirPath - Path of the directory resource to be resolvedpublic java.io.File asFile(java.lang.String resourcePath)
ResolverResolver.exists(String)public java.io.InputStream asStream(java.lang.String resourcePath)
ResolverResolver.exists(String)public void copyDirectory(java.lang.String dirPath,
java.io.File destinationDir)
ResolvercopyDirectory in interface ResolverdirPath - Path of the resource directory to resolvedestinationDir - Where the files should be copied topublic boolean hasLocalCache()
hasLocalCache in interface ResolverResolver.localCacheRoot()public java.io.File localCacheRoot()
localCacheRoot in interface ResolverResolver.hasLocalCache() returns falseprotected void assertExists(java.lang.String resourcePath)
Copyright © 2019. All rights reserved.