public class AbsoluteFromRelativeURI extends Object
This is a generic utility for resolving URIs, other than the fact that it's declared to throw TransformerException. Please see code comments for details on how resolution is performed.
| Constructor and Description |
|---|
AbsoluteFromRelativeURI() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAbsoluteURIFromRelative(String localPath)
Get an absolute URI from a given relative URI (local path).
|
static boolean |
isAbsolutePath(String systemId)
Return true if the local path is an absolute path.
|
public static String getAbsoluteURIFromRelative(String localPath)
The relative URI is a local filesystem path. The path can be absolute or relative. If it is a relative path, it is resolved relative to the system property "user.dir" if it is available; if not (i.e. in an Applet perhaps which throws SecurityException) then we just return the relative path. The space and backslash characters are also replaced to generate a good absolute URI.
localPath - The relative URI to resolvepublic static boolean isAbsolutePath(String systemId)
systemId - The path stringCopyright © 2019. All rights reserved.