|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.utils.SystemIDResolver
public class SystemIDResolver
This class is used to resolve relative URIs and SystemID strings into absolute URIs.
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 Summary | |
---|---|
SystemIDResolver()
|
Method Summary | |
---|---|
private static java.lang.String |
getAbsolutePathFromRelativePath(java.lang.String relativePath)
Return an absolute path from a relative path. |
static java.lang.String |
getAbsoluteURI(java.lang.String systemId)
Take a SystemID string and try to turn it into a good absolute URI. |
static java.lang.String |
getAbsoluteURI(java.lang.String urlString,
java.lang.String base)
Take a SystemID string and try to turn it into a good absolute URI. |
static java.lang.String |
getAbsoluteURIFromRelative(java.lang.String localPath)
Get an absolute URI from a given relative URI (local path). |
static boolean |
isAbsolutePath(java.lang.String systemId)
Return true if the local path is an absolute path. |
static boolean |
isAbsoluteURI(java.lang.String systemId)
Return true if the systemId denotes an absolute URI . |
private static boolean |
isWindowsAbsolutePath(java.lang.String systemId)
Return true if the local path is a Windows absolute path. |
private static java.lang.String |
replaceChars(java.lang.String str)
Replace spaces with "%20" and backslashes with forward slashes in the input string to generate a well-formed URI string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemIDResolver()
Method Detail |
---|
public static java.lang.String getAbsoluteURIFromRelative(java.lang.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 resolve
private static java.lang.String getAbsolutePathFromRelativePath(java.lang.String relativePath)
relativePath
- A relative path
public static boolean isAbsoluteURI(java.lang.String systemId)
systemId
- The systemId string
public static boolean isAbsolutePath(java.lang.String systemId)
systemId
- The path string
private static boolean isWindowsAbsolutePath(java.lang.String systemId)
systemId
- The path string
private static java.lang.String replaceChars(java.lang.String str)
str
- The input string
public static java.lang.String getAbsoluteURI(java.lang.String systemId)
systemId
- A URI string, which may be absolute or relative.
public static java.lang.String getAbsoluteURI(java.lang.String urlString, java.lang.String base) throws javax.xml.transform.TransformerException
urlString
- SystemID stringbase
- The URI string used as the base for resolving the systemID
javax.xml.transform.TransformerException
- thrown if the string can't be turned into a URI.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |