Class RelativePathResolver_impl

java.lang.Object
org.apache.uima.resource.impl.RelativePathResolver_impl
All Implemented Interfaces:
RelativePathResolver

public class RelativePathResolver_impl extends Object implements RelativePathResolver
Reference implementation of RelativePathResolver.
  • Constructor Details

    • RelativePathResolver_impl

      public RelativePathResolver_impl()
    • RelativePathResolver_impl

      public RelativePathResolver_impl(ClassLoader aClassLoader)
  • Method Details

    • getDataPath

      @Deprecated public String getDataPath()
      Deprecated.
      Description copied from interface: RelativePathResolver
      Gets the data path used to resolve relative paths. More than one directory may be specified by separating them with the System path.separator character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.

      Note: This method will only return file paths. If any non-file URLs have been added to the data path e.g via RelativePathResolver.setDataPathElements(URL...), these will not be included. Use RelativePathResolver.getDataPathUrls() to get a full list.

      Specified by:
      getDataPath in interface RelativePathResolver
      Returns:
      the data path
    • getDataPathElements

      @Deprecated public List<String> getDataPathElements()
      Deprecated.
      Description copied from interface: RelativePathResolver
      Gets the data path used to resolve relative paths. Elements of this path may be absolute or relative file paths.

      Note: This method will only return file paths. If any non-file URLs have been added to the data path e.g via RelativePathResolver.setDataPathElements(URL...), these will not be included. Use RelativePathResolver.getDataPathUrls() to get a full list.

      Specified by:
      getDataPathElements in interface RelativePathResolver
      Returns:
      the data path
    • getDataPathUrls

      public List<URL> getDataPathUrls()
      Description copied from interface: RelativePathResolver
      Gets the data path used to resolve relative paths. Elements of this path may be absolute or relative URLs.
      Specified by:
      getDataPathUrls in interface RelativePathResolver
      Returns:
      the data path
    • setDataPathElements

      public void setDataPathElements(File... aElements) throws MalformedURLException
      Description copied from interface: RelativePathResolver
      Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative file paths.
      Specified by:
      setDataPathElements in interface RelativePathResolver
      Parameters:
      aElements - the data path elements
      Throws:
      MalformedURLException - if a file path could not be converted to a URL
    • setDataPathElements

      public void setDataPathElements(String... aElements) throws MalformedURLException
      Description copied from interface: RelativePathResolver
      Sets the data path elements used to resolve relative paths. Elements of this path may be URLs or absolute or relative file paths.
      Specified by:
      setDataPathElements in interface RelativePathResolver
      Parameters:
      aElements - the data path elements
      Throws:
      MalformedURLException - if a file path could not be converted to a URL
    • setDataPathElements

      public void setDataPathElements(URL... aElements)
      Description copied from interface: RelativePathResolver
      Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative URLs.
      Specified by:
      setDataPathElements in interface RelativePathResolver
      Parameters:
      aElements - the data path aURLs
    • setDataPath

      @Deprecated public void setDataPath(String aPath) throws MalformedURLException
      Deprecated.
      Description copied from interface: RelativePathResolver
      Sets the data path used to resolve relative paths. More than one directory may be specified by separating them with the System path.separator character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.
      Specified by:
      setDataPath in interface RelativePathResolver
      Parameters:
      aPath - the data path
      Throws:
      MalformedURLException - if a file path could not be converted to a URL
    • resolveRelativePath

      public URL resolveRelativePath(String aPathOrUrl)
      Description copied from interface: RelativePathResolver
      Resolves a path relative to each element of the data path, sequentially starting with the first element. If this results in an absolute URL at which a file actually exists, that absolute URL is returned. If no file could be found, null is returned.

      Note: For backwards compatibility, it is still allowed to specify relative URLs here such as file:foo/foo.txt and this will effectively work as if foo/foo.txt had been specified. The protocol is simply discarded. Future versions will no longer accept a protocol in relative paths.

      Specified by:
      resolveRelativePath in interface RelativePathResolver
      Parameters:
      aPathOrUrl - the path/URL to be resolved (if an absolute URL is specified, it will be returned unmodified if a file actually exists at the URL; otherwise null will be returned).
      Returns:
      the absolute URL at which the file exists, null it none could be found.
    • resolveRelativePath

      @Deprecated public URL resolveRelativePath(URL aUrl)
      Deprecated.
      Description copied from interface: RelativePathResolver
      Resolves an URLrelative to each element of the data path, sequentially starting with the first element. If this results in an absolute URL at which a file actually exists, that absolute URL is returned. If no file could be found, null is returned.
      Specified by:
      resolveRelativePath in interface RelativePathResolver
      Parameters:
      aUrl - the URL to be resolved (if an absolute URL is specified, it will be returned unmodified if a file actually exists at the URL; otherwise null will be returned).
      Returns:
      the absolute URL at which the file exists, null it none could be found.
    • setPathResolverClassLoader

      public void setPathResolverClassLoader(ClassLoader aClassLoader)
      Description copied from interface: RelativePathResolver
      Sets the ClassLoader that should be used to resolve the resources.
      Specified by:
      setPathResolverClassLoader in interface RelativePathResolver
      Parameters:
      aClassLoader - the ClassLoader that should be used to resolve the resources.
      See Also:
    • fileExistsAtUrl

      protected boolean fileExistsAtUrl(URL aUrl)
    • getBaseUrls

      @Deprecated protected URL[] getBaseUrls()
      Deprecated.
      Use getDataPathUrls() instead.
      Returns:
      the base URLs that were parsed from the data path.