Class ResolverForClasspath

java.lang.Object
io.nosqlbench.nb.api.nbio.ResolverForClasspath
All Implemented Interfaces:
ContentResolver

public class ResolverForClasspath extends Object implements ContentResolver
Resolves resources which can be found via the class loader.

If a stream for a named resource is found, this resolver will provide a Path to it. If the classpath resolves a stream which contains a file: URI, then it is returned as a simple Path uri using the provided path component. If it is any other scheme, then filesystems are instantiated as needed to fully-qualify the resulting path, and then it is provided in external form.

  • Field Details

  • Constructor Details

    • ResolverForClasspath

      public ResolverForClasspath()
  • Method Details

    • resolve

      public List<Content<?>> resolve(URI uri)
      Description copied from interface: ContentResolver
      Locate 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.
      A content resolver may be given a path which is fundamentally incompatible with the schemes supported by the resolver implementation. It is required that the resolver return null for such URI values.
      Specified by:
      resolve in interface ContentResolver
      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
    • resolveDirectory

      public List<Path> resolveDirectory(URI uri)
      Description copied from interface: ContentResolver
      Return a list of matching directory Paths for the URI which 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:
      resolveDirectory in interface ContentResolver
      Parameters:
      uri -
      Returns:
      A list of accessible paths matching the uri, or an empty list
    • toString

      public String toString()
      Overrides:
      toString in class Object