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.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | Returns: The absolute pathA relative path relativePath)Return an absolute path from a relative path. |
| public static String | Returns: The resolved absolute URIA URI string, which may be absolute or relative. systemId)Take a SystemID string and try to turn it into a good absolute URI. |
| public static String | Returns: The resolved absolute URISystemID string urlString, String The URI string used as the base for resolving the systemID base)Take a SystemID string and try to turn it into a good absolute URI. |
| public static String | Returns: Resolved absolute URIThe relative URI to resolve localPath)Get an absolute URI from a given relative URI (local path). |
| public static boolean | Returns: true if the path is absoluteThe path string systemId)Return true if the local path is an absolute path. |
| public static boolean | Returns: true if the systemId is an an absolute URIThe systemId string systemId)Return true if the systemId denotes an absolute URI . |
| private static boolean | Returns: true if the path is a Windows absolute pathThe path string systemId)Return true if the local path is a Windows absolute path. |
| private static String | Returns: The string after conversionThe input string str)Replace spaces with "%20" and backslashes with forward slashes in the input string to generate a well-formed URI string. |
| SystemIDResolver | back to summary |
|---|---|
| public SystemIDResolver() | |
| getAbsolutePathFromRelativePath | back to summary |
|---|---|
| private static String getAbsolutePathFromRelativePath(String relativePath) Return an absolute path from a relative path. | |
| getAbsoluteURI | back to summary |
|---|---|
| public static String getAbsoluteURI(String systemId) Take a SystemID string and try to turn it into a good absolute URI. | |
| getAbsoluteURI | back to summary |
|---|---|
| public static String getAbsoluteURI(String urlString, String base) throws TransformerException Take a SystemID string and try to turn it into a good absolute URI.
| |
| getAbsoluteURIFromRelative | back to summary |
|---|---|
| public static String getAbsoluteURIFromRelative(String localPath) Get an absolute URI from a given relative URI (local path). 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 then we just return the relative path. The space and backslash characters are also replaced to generate a good absolute URI. | |
| isAbsolutePath | back to summary |
|---|---|
| public static boolean isAbsolutePath(String systemId) Return true if the local path is an absolute path.
| |
| isAbsoluteURI | back to summary |
|---|---|
| public static boolean isAbsoluteURI(String systemId) Return true if the systemId denotes an absolute URI .
| |
| isWindowsAbsolutePath | back to summary |
|---|---|
| private static boolean isWindowsAbsolutePath(String systemId) Return true if the local path is a Windows absolute path.
| |
| replaceChars | back to summary |
|---|---|
| private static String replaceChars(String str) Replace spaces with "%20" and backslashes with forward slashes in the input string to generate a well-formed URI string. | |