Package org.apache.uima.resource

# Interface RelativePathResolver

All Known Implementing Classes:
  `RelativePathResolver_impl`

public interface RelativePathResolver
Used by the resource manager to resolve relative URLs to absolute URLs.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `UIMA_DATAPATH_PROP`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDataPath()`
  Deprecated.
  Use `getDataPathElements()` instead.
  `List<String>`
  `getDataPathElements()`
  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)`
  Deprecated.
  Use `setDataPathElements(java.lang.String...)` instead.
  `void`
  `setDataPathElements(File... aElements)`
  Sets the data path elements used to resolve relative paths.
  `void`
  `setDataPathElements(String... aElements)`
  Sets the data path elements used to resolve relative paths.
  `void`
  `setPathResolverClassLoader(ClassLoader aClassLoader)`
  Sets the ClassLoader that should be used to resolve the resources.

- ## Field Details

  - ### UIMA_DATAPATH_PROP

    static final String UIMA_DATAPATH_PROP
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getDataPath

    @Deprecated String getDataPath()
    Deprecated.
    Use `getDataPathElements()` instead.
    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.
    Returns:
      the data path

  - ### getDataPathElements

    List<String> getDataPathElements()
    Gets the data path used to resolve relative paths. Elements of this path may be absolute or relative file paths.
    Returns:
      the data path

  - ### setDataPath

    @Deprecated void setDataPath(String aPath) throws MalformedURLException
    Deprecated.
    Use `setDataPathElements(java.lang.String...)` instead.
    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.
    Parameters:
      `aPath` - the data path
    Throws:
      `MalformedURLException` - if a file path could not be converted to a URL

  - ### setDataPathElements

    void setDataPathElements(String... aElements) throws MalformedURLException
    Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative file paths.
    Parameters:
      `aElements` - the data path elements
    Throws:
      `MalformedURLException` - if a file path could not be converted to a URL

  - ### setDataPathElements

    void setDataPathElements(File... aElements) throws MalformedURLException
    Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative file paths.
    Parameters:
      `aElements` - the data path elements
    Throws:
      `MalformedURLException` - if a file path could not be converted to a URL

  - ### resolveRelativePath

    URL resolveRelativePath(URL aRelativeUrl)
    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.
    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.

  - ### setPathResolverClassLoader

    void setPathResolverClassLoader(ClassLoader aClassLoader)
    Sets the ClassLoader that should be used to resolve the resources.
    Parameters:
      `aClassLoader` - the ClassLoader that should be used to resolve the resources.