gnu.xml.util
public class Resolver extends Object implements EntityResolver, Cloneable
FIXME: This needs to leverage a catalog facility.
Version: $Date: 2001/10/29 21:49:10 $
Constructor Summary | |
---|---|
Resolver(Dictionary dict)
Constructs a resolver which understands how to map PUBLIC identifiers
to other URIs, typically for local copies of standard DTD components.
|
Method Summary | |
---|---|
static void | addDirectoryMapping(Dictionary table, String[][] mappings, File directory)
Updates a dictionary used to map PUBLIC identifiers to file names,
so that it uses the mappings in a specified directory.
|
static String | fileNameToURL(String filename)
Provides the URL for a named file, without relying on the JDK 1.2
java.io.File#toURL File.toURL () utility method.
|
static String | fileToURL(File f)
Provides the URL for a file, without relying on the JDK 1.2
java.io.File#toURL File.toURL () utility method.
|
static String | getEncoding(String contentType)
This parses most MIME content type strings that have charset=...
encoding declarations to and returns the specified encoding. |
static String | getURL(String fileOrURL)
Returns a URL string. |
InputSource | resolveEntity(String publicId, String systemId)
Uses a local dictionary of public identifiers to resolve URIs,
normally with the goal of minimizing network traffic or latencies. |
Parameters: dictionary maps PUBLIC identifiers to URIs. This is not copied; subsequent modifications will be reported through the resolution operations.
Parameters: mappings Array of string pairs, where the first member of each pair is a PUBLIC identifier and the second is the name of a file, relative to the specified directory. directory File holding the specified files.
java.io.File#toURL File.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).
Throws: IOException if the file does not exist
java.io.File#toURL File.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).
Throws: IOException if the file does not exist
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
Parameters: fileOrURL If this is the name of a file which exists, then its URL is returned. Otherwise the argument is returned.
Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2011-08-26.