Class URIResolver
java.lang.Object
io.nosqlbench.nb.api.nbio.URIResolver
- All Implemented Interfaces:
ContentResolver
This is a stateful search object for resources like Paths or URLs.
It provides the abilitiy to look for URIs in any form, with simple
pluggable search back-ends, in some preferential order.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()Include resources from all known places, including remote URLs, the local default filesystem, and the classpath, which includes the jars that hold the current runtime application.extraPaths(String extraPath) inCP()Include resources within the classpath.inFS()Includ resources in the default filesystemInclude resources within the NBIO cache or download them if they are not found.inURLs()Include resources in remote URLsLocate the content referenced by the specified name.resolveAll(String uri) resolveAll(URI uri) resolveDirectory(URI uri) Return a list of matching directory Paths for theURIwhich are accessible under the scheme of the implementing resolver.Content<?> resolveOne(String candidatePath) resolveOneOptionally(String candidatePath) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.nosqlbench.nb.api.nbio.ContentResolver
resolveDirectory
-
Constructor Details
-
URIResolver
public URIResolver()
-
-
Method Details
-
all
Include resources from all known places, including remote URLs, the local default filesystem, and the classpath, which includes the jars that hold the current runtime application.- Returns:
- this URISearch
-
inFS
-
inURLs
-
inCP
-
inNBIOCache
Include resources within the NBIO cache or download them if they are not found.- Returns:
- this URISearch
-
resolve
- Specified by:
resolvein interfaceContentResolver
-
resolveDirectory
Description copied from interface:ContentResolverReturn a list of matching directory Paths for theURIwhich are accessible under the scheme of the implementing resolver. It is possible that a logical path can return more than one physical directory path, such as with jar files.- Specified by:
resolveDirectoryin interfaceContentResolver- Parameters:
uri-- Returns:
- A list of accessible paths matching the uri, or an empty list
-
resolve
Description copied from interface:ContentResolverLocate the content referenced by the specified name. Content is any URL or file path which contains data to be loaded.Implementors should take care to ensure the following conditions are met:
- For URL style content, resolution is only successful if a stream to download the content is acquired.
- For file paths, resolution is only successful if the filesystem does a standard access check for readability of a file that is present.
- Specified by:
resolvein interfaceContentResolver- Parameters:
uri- The URI of a content location, like a file name or URL.- Returns:
- A content element which may then be used to access the content
-
resolveAll
-
resolveAll
-
extension
-
extraPaths
-
resolveOneOptionally
-
resolveOne
-
toString
-