|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.xml.FileResolver
public final class FileResolver
A FileResolver provides various resolvers for external identifiers and URI references.
Any resolution is based on the file systems known by the underlying implementation without performing catalog lookup.
Some static methods provides error handling while resolving.
resolvePath(String, Object, XFile)
allows to resolve
a relative path regarding a xml:base.
Field Summary | |
---|---|
static EntityResolver |
EXTERNAL_IDENTITY_RESOLVER
Resolve external identifiers without catalog lookup ; support many URI schemes. |
static URIResolver |
URI_REFERENCE_RESOLVER
Resolve URI references without catalog lookup ; support many URI schemes. |
Method Summary | |
---|---|
Source |
resolve(String href,
String base)
Resolve an URI reference. |
static Source |
resolve(String href,
String base,
ErrorListener errorListener)
Resolve an URI reference. |
InputSource |
resolveEntity(String publicId,
String systemId)
Resolve an external identifier. |
static InputSource |
resolveEntity(String publicId,
String systemId,
ErrorHandler errorHandler)
Resolve an external identifiers. |
static XFile |
resolvePath(String path,
Object node,
XFile baseFile)
Resolve a path to a file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EntityResolver EXTERNAL_IDENTITY_RESOLVER
public static final URIResolver URI_REFERENCE_RESOLVER
Method Detail |
---|
public static final InputSource resolveEntity(String publicId, String systemId, ErrorHandler errorHandler) throws SAXException, IOException
publicId
- The public ID of the external identifier.systemId
- The system ID of the external identifier.errorHandler
- An error handler that report warning
when an I/O error occurs ; may be null
.
null
if an I/O error
has been reported by the error handler.
SAXException
- May be thrown if no error handler is supplied.
IOException
- May be thrown if no error handler is supplied.public static final Source resolve(String href, String base, ErrorListener errorListener) throws TransformerException
href
- The URI to resolve.base
- The base URI, if any.errorListener
- An error listener that report warning
when an I/O error occurs ; may be null
.
null
if an I/O error
has been reported by the error listener.
TransformerException
- May be thrown if no error listener is supplied.public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver
publicId
- The public ID of the external identifier.systemId
- The system ID of the external identifier.
SAXException
IOException
EntityResolver.resolveEntity(java.lang.String, java.lang.String)
public Source resolve(String href, String base) throws TransformerException
resolve
in interface URIResolver
href
- The URI to resolve.base
- The base URI, if any.
TransformerException
URIResolver.resolve(java.lang.String, java.lang.String)
public static final XFile resolvePath(String path, Object node, XFile baseFile) throws FileSystemException
Absolute paths are returned as-is. Relative paths are absolutized regarding the xml:base attribute defined in the node and/or its ancestor.
path
- The path to the resource, possibly relative.node
- The node that may define itself or one of
its ancestor an xml:base in order to resolve
relative paths. If the path specified by xml:base
is a relative path, it is absolutized regarding the xml:base
specified by its nearest ancestor, and so on.baseFile
- The base to use in the last resort, shouldn't be null
.
null
will be returned
if the path haven't been absolutized because the base
file given was also null
.
FileSystemException
- When an I/O error occurs.Node
,
SAXNode
,
XOperable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |