Package org.apache.uima.resource.impl
Class RelativePathResolver_impl
java.lang.Object
org.apache.uima.resource.impl.RelativePathResolver_impl
- All Implemented Interfaces:
RelativePathResolver
Reference implementation of
RelativePathResolver
.-
Field Summary
Fields inherited from interface org.apache.uima.resource.RelativePathResolver
UIMA_DATAPATH_PROP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
fileExistsAtUrl
(URL aUrl) protected URL[]
Deprecated.Gets the data path used to resolve relative paths.resolveRelativePath
(URL aRelativeUrl) Resolves a relative URL to an absolute URL.void
setDataPath
(String aPath) Deprecated.void
setDataPathElements
(File... aPaths) Sets the data path elements used to resolve relative paths.void
setDataPathElements
(String... aPaths) 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.
-
Constructor Details
-
RelativePathResolver_impl
public RelativePathResolver_impl() -
RelativePathResolver_impl
-
-
Method Details
-
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 Systempath.separator
character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.- Specified by:
getDataPath
in interfaceRelativePathResolver
- Returns:
- the data path
-
getDataPathElements
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.- Specified by:
getDataPathElements
in interfaceRelativePathResolver
- Returns:
- the data path
-
setDataPathElements
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 interfaceRelativePathResolver
- Parameters:
aPaths
- the data path elements- Throws:
MalformedURLException
- if a file path could not be converted to a URL
-
setDataPathElements
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 interfaceRelativePathResolver
- Parameters:
aPaths
- the data path elements- Throws:
MalformedURLException
- if a file path could not be converted to a URL
-
setDataPath
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 Systempath.separator
character (; on windows, : on UNIX). Elements of this path may be absolute or relative file paths.- Specified by:
setDataPath
in interfaceRelativePathResolver
- Parameters:
aPath
- the data path- Throws:
MalformedURLException
- if a file path could not be converted to a URL
-
resolveRelativePath
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 interfaceRelativePathResolver
- 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; otherwisenull
will be returned).- Returns:
- the absolute URL at which the file exists,
null
it none could be found.
-
setPathResolverClassLoader
Description copied from interface:RelativePathResolver
Sets the ClassLoader that should be used to resolve the resources.- Specified by:
setPathResolverClassLoader
in interfaceRelativePathResolver
- Parameters:
aClassLoader
- the ClassLoader that should be used to resolve the resources.- See Also:
-
fileExistsAtUrl
-
getBaseUrls
- Returns:
- the base URLs that were parsed from the data path.
-