Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.xml.util.Resolver
XCat
Constructor Summary | |
|
Method Summary | |
static void |
|
static String |
|
static String |
|
static String |
|
static String |
|
InputSource |
|
public Resolver(Dictionary dict)
Constructs a resolver which understands how to map PUBLIC identifiers to other URIs, typically for local copies of standard DTD components.
- Parameters:
public static void addDirectoryMapping(Dictionary table, mappings[][] , File directory) throws IOException
Updates a dictionary used to map PUBLIC identifiers to file names, so that it uses the mappings in a specified directory.
- Parameters:
directory
- File holding the specified files.
public static String fileNameToURL(String filename) throws IOException
Provides the URL for a named file, without relying on the JDK 1.2File.toURL
() utility method.
- Parameters:
filename
- the file name to convert. Relative file names are resolved the way the JVM resolves them (current to the process-global current working directory).
public static String fileToURL(File f) throws IOException
Provides the URL for a file, without relying on the JDK 1.2File.toURL
() utility method.
- Parameters:
f
- the file to convert. Relative file names are resolved the way the JVM resolves them (current to the process-global current working directory).
public static String getEncoding(String contentType)
This parses most MIME content type strings that have charset=... encoding declarations to and returns the specified encoding. This conforms to RFC 3023, and is useful when constructing InputSource objects from URLConnection objects or other objects using MIME content typing.
- Parameters:
contentType
- the MIME content type that will be parsed; must not be null.
- Returns:
- the appropriate encoding, or null if the content type is not text and there's no
charset=...
attribute
public static String getURL(String fileOrURL)
Returns a URL string. Note that if a malformed URL is provided, or the parameter names a nonexistent file, the resulting URL may be malformed.
- Parameters:
fileOrURL
- If this is the name of a file which exists, then its URL is returned. Otherwise the argument is returned.
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
Uses a local dictionary of public identifiers to resolve URIs, normally with the goal of minimizing network traffic or latencies.
- Specified by:
- resolveEntity in interface EntityResolver