Package net.sf.saxon.resource
Class UnknownResource
java.lang.Object
net.sf.saxon.resource.UnknownResource
- All Implemented Interfaces:
Resource
The class is an implementation of the generic Resource object (typically an item in a collection)
representing a resource whose type is not yet known - typically because it uses an unregistered
file extension. We attempt to establish a type for the resource when it is opened, by "sniffing" the content.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnknownResource
(XPathContext context, AbstractResourceCollection.InputDetails details) -
Method Summary
Modifier and TypeMethodDescriptionGet the media type (MIME type) of the resource if knowngetItem()
Get an item representing the resource: in this case a document node for the XML document.Get a URI that identifies this resource
-
Field Details
-
FACTORY
-
-
Constructor Details
-
UnknownResource
-
-
Method Details
-
getResourceURI
Description copied from interface:Resource
Get a URI that identifies this resource- Specified by:
getResourceURI
in interfaceResource
- Returns:
- a URI identifying this resource
-
getItem
Get an item representing the resource: in this case a document node for the XML document.- Specified by:
getItem
in interfaceResource
- Returns:
- the document; or null if there is an error and the error is to be ignored
- Throws:
XPathException
- if (for example) XML parsing fails
-
getContentType
Get the media type (MIME type) of the resource if known- Specified by:
getContentType
in interfaceResource
- Returns:
- the string "application/xml"
-