org.apache.uima.resource.impl

## 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`.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.uima.resource.RelativePathResolver

      `UIMA_DATAPATH_PROP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RelativePathResolver_impl()`
    `RelativePathResolver_impl(ClassLoader aClassLoader)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `fileExistsAtUrl(URL aUrl)`
    `protected URL[]` | `getBaseUrls()`
    `String` | `getDataPath()` Gets the data path used to resolve relative paths.
    `URL` | `resolveRelativePath(URL aRelativeUrl)` Resolves a relative URL to an absolute URL.
    `void` | `setDataPath(String aPath)` Sets the data path used to resolve relative paths.
    `void` | `setPathResolverClassLoader(ClassLoader aClassLoader)` Sets the ClassLoader that should be used to resolve the resources.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RelativePathResolver_impl

          public RelativePathResolver_impl()

    - #### RelativePathResolver_impl

          public RelativePathResolver_impl(ClassLoader aClassLoader)

  - ### Method Detail

    - #### getDataPath

          public String getDataPath()

      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.
      Specified by:
        `getDataPath` in interface `RelativePathResolver`
      Returns:
        the data path
      See Also:
        `RelativePathResolver.getDataPath()`

    - #### setDataPath

          public void setDataPath(String aPath)
                           throws MalformedURLException

      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
      See Also:
        `RelativePathResolver.setDataPath(java.lang.String)`

    - #### resolveRelativePath

          public URL resolveRelativePath(URL aRelativeUrl)

      Description copied from interface: `RelativePathResolver`
      Resolves a relative URL to an absolute URL. This will attempt to resolve the URL 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.
      Specified by:
        `resolveRelativePath` in interface `RelativePathResolver`
      Parameters:
        `aRelativeUrl` - the relative 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.
      See Also:
        `RelativePathResolver.resolveRelativePath(java.net.URL)`

    - #### 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:
        `RelativePathResolver.setPathResolverClassLoader(java.lang.ClassLoader)`

    - #### fileExistsAtUrl

          protected boolean fileExistsAtUrl(URL aUrl)

    - #### getBaseUrls

          protected URL[] getBaseUrls()

      Returns:
        the base URLs that were parsed from the data path.

Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.