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 -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.UsegetDataPathUrls()
instead.Gets the data path used to resolve relative paths.resolveRelativePath
(String aPathOrUrl) Resolves a path relative to each element of the data path, sequentially starting with the first element.resolveRelativePath
(URL aUrl) Deprecated.UseresolveRelativePath(String)
instead.void
setDataPath
(String aPath) Deprecated.UsesetDataPathElements(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
setDataPathElements
(URL... aURLs) 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
- See Also:
-
-
Method Details
-
getDataPath
Deprecated.UsegetDataPathElements()
instead.Gets the data path used to resolve relative paths. More than one directory may be specified by separating them with the Systempath.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
setDataPathElements(URL...)
, these will not be included. UsegetDataPathUrls()
to get a full list.- Returns:
- the data path
-
getDataPathElements
Deprecated.UsegetDataPathUrls()
instead.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
setDataPathElements(URL...)
, these will not be included. UsegetDataPathUrls()
to get a full list.- Returns:
- the data path
-
getDataPathUrls
Gets the data path used to resolve relative paths. Elements of this path may be absolute or relative URLs.- Returns:
- the data path
-
setDataPath
Deprecated.UsesetDataPathElements(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 Systempath.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
Sets the data path elements used to resolve relative paths. Elements of this path may be URLs or 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
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
Sets the data path elements used to resolve relative paths. Elements of this path may be absolute or relative URLs.- Parameters:
aURLs
- the data path aURLs
-
resolveRelativePath
Deprecated.UseresolveRelativePath(String)
instead.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.- 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; otherwisenull
will be returned).- Returns:
- the absolute URL at which the file exists,
null
it none could be found.
-
resolveRelativePath
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 iffoo/foo.txt
had been specified. The protocol is simply discarded. Future versions will no longer accept a protocol in relative paths.- 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; otherwisenull
will be returned).- Returns:
- the absolute URL at which the file exists,
null
it none could be found.
-
setPathResolverClassLoader
Sets the ClassLoader that should be used to resolve the resources.- Parameters:
aClassLoader
- the ClassLoader that should be used to resolve the resources.
-
getDataPathElements()
instead.