public class FileEntityResolver extends EmptyEntityResolver
Therefore this simple entity resolver implementation is capable of returning proper InputResource instances for file ids on the local system.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DTD_EXTENSION |
Constructor and Description |
---|
FileEntityResolver()
Initialize the new instance with default values.
|
FileEntityResolver(boolean validating)
Initialize the new instance with the setting if the parser is validating
the XML input.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
extractFilename(java.lang.String id) |
protected boolean |
isDTD(java.lang.String filename) |
protected boolean |
isValidating() |
protected void |
isValidating(boolean newValue) |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
If the given systemId specifies a file in the local file system an
InputSource with an opended FileInputStream on this file will be returned.
|
protected StringUtil |
str() |
protected static final java.lang.String DTD_EXTENSION
public FileEntityResolver()
public FileEntityResolver(boolean validating)
validating
- Determines whether the resolver must return a resource for a DTD or notpublic org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class EmptyEntityResolver
publicId
- The public identifier of the external entity
being referenced, or null if none was supplied.systemId
- The system identifier of the external entity
being referenced.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.java.io.IOException
- A Java-specific IO exception,
possibly the result of creating a new InputStream
or Reader for the InputSource.InputSource
protected boolean isDTD(java.lang.String filename)
protected java.lang.String extractFilename(java.lang.String id)
protected StringUtil str()
protected boolean isValidating()
protected void isValidating(boolean newValue)