public abstract class AbstractResourceCollection extends Object implements ResourceCollection
Modifier and Type | Class and Description |
---|---|
static class |
AbstractResourceCollection.InputDetails |
Modifier and Type | Field and Description |
---|---|
protected String |
collectionURI |
protected URIQueryParameters |
params |
Constructor and Description |
---|
AbstractResourceCollection() |
Modifier and Type | Method and Description |
---|---|
String |
getCollectionURI()
Get the URI of the collection
|
protected AbstractResourceCollection.InputDetails |
getInputDetails(String resourceURI) |
protected String |
guessContentType(String resourceURI,
InputStream stream)
Guess the content type of a resource from its name and/or its content
|
boolean |
isStable(XPathContext context)
Ask whether the collection is stable.
|
Resource |
makeResource(Configuration config,
AbstractResourceCollection.InputDetails details,
String resourceURI)
Internal method to make a resource for a single entry in the ZIP or JAR file.
|
protected ParseOptions |
optionsFromQueryParameters(URIQueryParameters params,
XPathContext context) |
void |
registerContentType(String contentType,
ResourceFactory factory)
Associate a media type with a resource factory.
|
void |
registerFileExtension(String extension,
String contentType)
Associate a file extension with a media type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResources, getResourceURIs
protected String collectionURI
protected URIQueryParameters params
public String getCollectionURI()
ResourceCollection
getCollectionURI
in interface ResourceCollection
public boolean isStable(XPathContext context)
ResourceCollection.getResources(XPathContext)
or ResourceCollection.getResourceURIs(XPathContext)
isStable
in interface ResourceCollection
context
- the XPath evaluation context.
FeatureKeys.STABLE_COLLECTION_URI} is set.public void registerFileExtension(String extension, String contentType)
public void registerContentType(String contentType, ResourceFactory factory)
protected ParseOptions optionsFromQueryParameters(URIQueryParameters params, XPathContext context)
protected AbstractResourceCollection.InputDetails getInputDetails(String resourceURI) throws XPathException
XPathException
protected String guessContentType(String resourceURI, InputStream stream)
resourceURI
- the resource URIstream
- the content of the resource. The stream must be positioned at the start.
The method looks ahead in this stream
but resets the current position on exit.public Resource makeResource(Configuration config, AbstractResourceCollection.InputDetails details, String resourceURI) throws XPathException
config
- The Saxon configurationdetails
- Details of the input, including the input stream delivering the content of the resource.
The method is expected to
consume this input stream; the caller will close it on return.resourceURI
- the URI of the entry within the ZIP or JAR file; this will by default be
in the form collectionURI!pathXPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.