|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.filesystem.XProcFilesystem
public abstract class XProcFilesystem
This class is the core of file-/stream access in MorganaXProc
although it does not
provide any file-/stream access itself. This task is left to extending classes.
The basic methods for access files and streams via uri are implemented. The core
implementation is left over to classes extending XProcFilesystem
.
Practically you will probably never extend XProcFilesystem
but extend one of the classes
already implementing the abstract methods in XProcFilesystem
. Typically you will
extends DefaultFilesystem
or AlternativeFilesystem
to add support for
additional uri schemes or enhance the implemented methods for http-request.
Nested Class Summary | |
---|---|
class |
XProcFilesystem.DefectiveURIException
|
static class |
XProcFilesystem.LoadResult
A class wrapping the results from loading a resource from an uri. |
static class |
XProcFilesystem.ParseMode
The parsing modes used when building XOM documents. |
static class |
XProcFilesystem.ProtectedResourceException
An Exception thrown if the request resource needs authentication. |
class |
XProcFilesystem.StreamResult
A class wrapping an InputStream and the uri from which the input stream
was obtained. |
static class |
XProcFilesystem.UnknownSchemeException
An Exception thrown if the scheme in an uri is not known or not supported. |
class |
XProcFilesystem.UnsupportedMethodException
An Exception thrown if a XProcHttpRequest which an unsupported method
is found. |
static class |
XProcFilesystem.UnsupportedXMLVersionException
|
Field Summary | |
---|---|
static java.lang.String |
DIRECTORY_MARKER
A prefix to mark directory entries in the result of getDirectoryList . |
protected XProcConfiguration |
theConfig
|
Constructor Summary | |
---|---|
protected |
XProcFilesystem(XProcConfiguration config)
|
Method Summary | |
---|---|
nu.xom.Document |
build(java.lang.String textDoc,
java.lang.String uri,
XProcFilesystem.ParseMode parseMode)
Builds a XOM document from the given String using the given parseMode and
with uri as base uri for the document. |
protected abstract void |
clearCookieStore()
Makes sure the cookie store used for httpRequest is empty. |
XProcFilesystem |
copy(XProcConfiguration newConfig)
Creates a new instance of the XProcFilesystem. |
protected abstract java.net.URI |
copyResource(java.net.URI source,
java.net.URI target)
Copies resource source to target . |
java.net.URI |
copyResourceChecked(java.net.URI source,
java.net.URI target)
Implementation for pxf:copy |
protected abstract java.net.URI |
createDirectory(java.net.URI uri)
Create the directory names by the uri. |
java.net.URI |
createDirectoryChecked(java.net.URI uri)
Implementation for pxf:mkdir |
protected abstract java.net.URI |
createTemp(java.net.URI uri,
boolean createFolder,
java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit)
Create Create a temp file in the directory named by uri . |
java.net.URI |
createTempChecked(java.net.URI folderURI,
boolean createFolder,
java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit)
|
protected abstract void |
deleteResource(java.net.URI uri,
boolean recursive)
Delete the resource designated by uri. |
void |
deleteResourceChecked(java.net.URI uri,
boolean recursive)
Implementation for pxf:delete |
XProcHttpResponse |
doHttpRequest(XProcHttpRequest request,
com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space)
This method performs a http request by calling abstract method httpRequest(XProcHttpRequest)
or (if this fails) by getting the uri via getInputStream for method 'get'. |
javax.xml.transform.stream.StreamSource |
getAsStreamSource(java.net.URI uri)
|
protected abstract java.lang.String |
getContentType(java.net.URI uri)
Return the content type of the resource designated by uri . |
protected abstract java.lang.String[] |
getDirectoryList(java.net.URI uri)
Returns a list of the resource names found in the directory found on the given uri . |
java.lang.String[] |
getDirectoryList(XProcSecurityManager.Operations operation,
java.net.URI uri)
Gets a list of resource names in the directory named by the uri after a security check
for the given operation is performed. |
protected nu.xom.Document |
getDocument(java.net.URI uri,
XProcFilesystem.ParseMode parseMode)
Creates a new XOM document by getting an InputStream via getInputStream
for the given uri and then building it, using the given parseMode . |
protected abstract java.lang.String |
getEncoding(java.net.URI uri)
Return the encoding of the resource designated by uri . |
protected abstract XProcFilesystem.StreamResult |
getInputStream(java.net.URI uri)
Returns a StreamResult from the given uri . |
XProcFilesystem.LoadResult |
getLoadResult(XProcSecurityManager.Operations operation,
java.lang.String href,
java.net.URI primaryBase,
java.lang.String secondaryBase,
java.lang.String contentType,
java.lang.String dataWrapper)
Returns a LoadResult obtained from href made absolute by using
primaryBase or (if this fails) by secondaryBase after performing a
security check for the given operation . |
protected abstract java.io.OutputStream |
getOutputStream(java.net.URI uri)
Returns an OutputStream associated with the given uri . |
protected abstract nu.xom.Document |
getResourceInfo(java.net.URI uri,
boolean writeAllowed)
Returns a document as specified for pxf:info or null, if the resource does not exist. |
nu.xom.Document |
getResourceInfoChecked(java.net.URI uri)
Implementation for pxf:info |
protected abstract XProcHttpResponse |
httpRequest(XProcHttpRequest request)
Returns a XProcHttpResponse answering the given XProcHttpRequest . |
nu.xom.Document |
loadDocument(XProcSecurityManager.Operations operation,
java.lang.String href,
java.net.URI primaryBase,
java.lang.String secondaryBase,
XProcFilesystem.ParseMode parseMode)
Returns a XOM document from the URI given by href either made absolute
by using primaryBase or, if this fails, by using secondaryBase . |
nu.xom.Document |
loadDocument(XProcSecurityManager.Operations operation,
java.net.URI uri,
XProcFilesystem.ParseMode parseMode)
Returns a XOM document from the given uri build with the given parseMode after
a security check is performed for the given operation . |
nu.xom.Document |
loadDocumentFromPackage(XProcSecurityManager.Operations op,
java.lang.String href,
com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space,
XProcFilesystem.ParseMode mode)
Tries to load a component as document from an EXPath packaging system, if one is installed. |
protected abstract java.net.URI |
moveResource(java.net.URI source,
java.net.URI target)
Moves file source to target . |
java.net.URI |
moveResourceChecked(java.net.URI source,
java.net.URI target)
Implementation for pxf:move |
javax.xml.transform.stream.StreamSource |
resolveAsStreamSource(java.lang.String href,
java.lang.String base,
com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space)
|
java.util.List<java.net.URI> |
resolveCollection(java.net.URI theURI)
Represents the default implementation for fn:collection used in XPath, p:xquery and p:xslt. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
|
java.util.List<javax.xml.transform.stream.StreamSource> |
resolveModule(java.lang.String targetNamespace,
java.util.List<java.lang.String> locationHints,
java.lang.String baseURI)
Called to resolve module import in XQuery and p:xquery |
java.lang.String |
resolveText(java.net.URI absoluteURI,
java.lang.String encoding)
|
java.net.URI |
resolveURI(java.lang.String href,
java.net.URI baseURI)
Generates an absolute URI from href and
baseURI . |
protected abstract java.net.URI |
touchResource(java.net.URI uri,
long timeStamp)
|
java.net.URI |
touchResourceChecked(java.net.URI uri,
long timestamp)
Implementation for pxf:touch |
protected void |
writeData(byte[] data,
java.net.URI uri)
Writes data to the uri . |
java.lang.String |
writeData(XProcSecurityManager.Operations operation,
byte[] data,
java.net.URI uri)
Writes data to the uri after a security check for
the given operation is performed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DIRECTORY_MARKER
getDirectoryList
.
protected final XProcConfiguration theConfig
Constructor Detail |
---|
protected XProcFilesystem(XProcConfiguration config)
Method Detail |
---|
public XProcFilesystem copy(XProcConfiguration newConfig) throws java.lang.Exception
Creates a new instance of the XProcFilesystem. This method is used in XProcConfiguration to create
a new instance while creating a copy of an XProcConfiguration.
Implementers should overwrite this method, if the implementation does not support
constructor with (XProcConfiguration config).
newConfig
- the newConfiguration for the XProcFilesystem.
java.lang.Exception
- thrown, when unable to create a new instance.protected abstract XProcFilesystem.StreamResult getInputStream(java.net.URI uri) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException
StreamResult
from the given uri
.
uri
- the uri from which the StreamResult
should be taken.
StreamResult
an the given uri.
java.io.IOException
- if an error occurred reading the uri.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).protected abstract java.io.OutputStream getOutputStream(java.net.URI uri) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException
OutputStream
associated with the given uri
.
uri
- the uri for which the OutputStream
is requested.
java.io.IOException
- if an error occurred making the OutputStream
for the uri.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).protected abstract java.lang.String getContentType(java.net.URI uri) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException
uri
.
uri
- the uri for which the content type is requested.
java.io.IOException
- if any error occurred while requesting the content type.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).protected abstract java.lang.String getEncoding(java.net.URI uri) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException
uri
.
uri
- the uri for which the encoding is requested.
java.io.IOException
- if any error occurred while requesting the encoding.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).protected abstract XProcHttpResponse httpRequest(XProcHttpRequest request) throws java.io.IOException, XProcFilesystem.UnknownSchemeException
XProcHttpResponse
answering the given XProcHttpRequest
.
request
- the request to answer.
XProcHttpResponse
for this request.
java.io.IOException
- if an IOException occurred.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.protected abstract void clearCookieStore()
httpRequest
is empty.
protected abstract java.lang.String[] getDirectoryList(java.net.URI uri) throws java.io.IOException, XProcFilesystem.ProtectedResourceException, XProcFilesystem.UnknownSchemeException
uri
. If the
uri does not name a directory, an IOException
is thrown. The names appearing in the
result are just the file names, i.e. the last segment of the path. If the directory at uri
contains directories, the names of this directories must be returned
prefix with DIRECTORY_MARKER
.
uri
- the uri for which the directory listing is requested.
java.io.IOException
- if an error occurred reading the resource at uri or if the resource is no directory.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.protected abstract nu.xom.Document getResourceInfo(java.net.URI uri, boolean writeAllowed) throws XProcFilesystem.UnknownSchemeException, java.io.IOException, java.io.FileNotFoundException
uri
- the uri to get the information for.
XProcFilesystem.UnknownSchemeException
java.io.IOException
java.io.FileNotFoundException
protected abstract java.net.URI copyResource(java.net.URI source, java.net.URI target) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
source
to target
. If target
names
a folder, the copy is put into this folder. If a file with target
already exists,
it is overwritten.
source
- a uri designating a filetarget
- a uri designating a file or a folder
source
was copied to.
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
protected abstract java.net.URI moveResource(java.net.URI source, java.net.URI target) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
source
to target
. If target
names
a folder, the copy is put into this folder. If a file with target
already exists,
it is overwritten.
source
- target
-
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
protected abstract void deleteResource(java.net.URI uri, boolean recursive) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
recursive
must be true, otherwise an IOException
is thrown.
uri
- recursive
-
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
protected abstract java.net.URI touchResource(java.net.URI uri, long timeStamp) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
uri
- timeStamp
- value.
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
protected abstract java.net.URI createDirectory(java.net.URI uri) throws XProcFilesystem.UnknownSchemeException, java.io.IOException
uri
-
XProcFilesystem.UnknownSchemeException
java.io.IOException
protected abstract java.net.URI createTemp(java.net.URI uri, boolean createFolder, java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
uri
.
uri
- the directory in which the temp file should be created.prefix
- the file names prefix or null.suffix
- the file names suffix or null.deleteOnExit
- true, if the created file should be deleted when the processor terminates.
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
public final java.net.URI createDirectoryChecked(java.net.URI uri) throws XProcFilesystem.UnknownSchemeException, java.io.IOException, XProcSecurityException
uri
-
XProcFilesystem.UnknownSchemeException
java.io.IOException
XProcSecurityException
public final java.net.URI createTempChecked(java.net.URI folderURI, boolean createFolder, java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit) throws XProcSecurityException, XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, java.io.IOException
folderURI
- createFolder
- prefix
- suffix
- deleteOnExit
-
XProcSecurityException
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
java.io.IOException
public final java.net.URI touchResourceChecked(java.net.URI uri, long timestamp) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, XProcSecurityException, java.io.IOException
uri
- timestamp
-
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
XProcSecurityException
java.io.IOException
public final java.net.URI moveResourceChecked(java.net.URI source, java.net.URI target) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, XProcSecurityException, java.io.IOException
source
- target
-
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
XProcSecurityException
java.io.IOException
public final java.net.URI copyResourceChecked(java.net.URI source, java.net.URI target) throws XProcFilesystem.UnknownSchemeException, java.io.FileNotFoundException, XProcSecurityException, java.io.IOException
source
- target
-
XProcFilesystem.UnknownSchemeException
java.io.FileNotFoundException
XProcSecurityException
java.io.IOException
public final void deleteResourceChecked(java.net.URI uri, boolean recursive) throws XProcSecurityException, java.io.FileNotFoundException, XProcFilesystem.UnknownSchemeException, java.io.IOException
uri
- recursive
-
XProcSecurityException
java.io.FileNotFoundException
XProcFilesystem.UnknownSchemeException
java.io.IOException
public final nu.xom.Document getResourceInfoChecked(java.net.URI uri) throws XProcSecurityException, java.io.IOException, java.io.FileNotFoundException, XProcFilesystem.UnknownSchemeException
uri
-
XProcSecurityException
java.io.IOException
java.io.FileNotFoundException
XProcFilesystem.UnknownSchemeException
public java.util.List<java.net.URI> resolveCollection(java.net.URI theURI) throws javax.xml.xpath.XPathException
The default behavior is this:
getDirectoryList()
for the given uri. If
this is successful, all visible files with extension ".xml" will be returned.
getDirectoryList()
fails, the uri is taken to name an xml
document. This document must have a root element named collection
.
if there are child elements named doc
with an attribute named
href
, the value of this attribute is taken as uri to a document
in the collection. If the uri is relative, it is resolved against the
uri of the collection
-document.
resolveCollection
in interface CollectionURIResolver
theURI
- which designates the collection
javax.xml.xpath.XPathException
- raised, if any Exception occured.public final javax.xml.transform.stream.StreamSource getAsStreamSource(java.net.URI uri) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public final java.net.URI resolveURI(java.lang.String href, java.net.URI baseURI) throws java.io.IOException
URI
from href
and
baseURI
. If href
is relative, baseURI
is used
to make it absolute.
href
- an uri (fragment).baseURI
- an absolute uri.
href
and baseURI
.
java.io.IOException
- if href
is null or href
is relative and
baseURI
is null or there is a syntax error in href
.public final nu.xom.Document loadDocument(XProcSecurityManager.Operations operation, java.lang.String href, java.net.URI primaryBase, java.lang.String secondaryBase, XProcFilesystem.ParseMode parseMode) throws java.io.IOException, nu.xom.ValidityException, nu.xom.ParsingException, XProcFilesystem.UnknownSchemeException, XProcSecurityException, XProcFilesystem.ProtectedResourceException, XProcFilesystem.UnsupportedXMLVersionException, XProcFilesystem.DefectiveURIException
Returns a XOM document from the URI
given by href
either made absolute
by using primaryBase
or, if this fails, by using secondaryBase
. The document
is build with the given parseMode
after a security check is performed for the given
operation
. After making href
absolute in the specified way,
loadDocument(Operations,URI,ParseMode)
is called.
operation
- the Operation
for which the docuement should be loaded.href
- the uri (fragment) form which the document should be loaded.primaryBase
- the first uri to use to make href
absolute.secondaryBase
- the second uri to use to make href
absolute.
href
and either primaryBase
or secondary base
.
java.io.IOException
- if an IOException
occurred obtaining the input stream.
nu.xom.ParsingException
- if the input stream is not a valid document.
nu.xom.ValidityException
- if the input stream is not a valid document.
XProcFilesystem.UnknownSchemeException
- if the scheme in uri
is unknown or not supported.
XProcSecurityException
- if accessing this resource for this operation
is
forbidden by the current setting of XProcSecurityManager
.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).
XProcFilesystem.UnsupportedXMLVersionException
- if the document is in an xml version not supported.
XProcFilesystem.DefectiveURIException
public final nu.xom.Document loadDocument(XProcSecurityManager.Operations operation, java.net.URI uri, XProcFilesystem.ParseMode parseMode) throws java.io.IOException, nu.xom.ParsingException, nu.xom.ValidityException, XProcFilesystem.UnknownSchemeException, XProcSecurityException, XProcFilesystem.ProtectedResourceException, XProcFilesystem.UnsupportedXMLVersionException, XProcFilesystem.DefectiveURIException
Returns a XOM document from the given uri
build with the given parseMode
after
a security check is performed for the given operation
. To build the document from the
uri getDocument
is called.
operation
- the Operations
for which the document should be loaded.uri
- the uri from which the document should be loaded.parseMode
- the ParseMode
to use for building the document.
uri
.
java.io.IOException
- if an IOException
occurred obtaining the input stream.
nu.xom.ParsingException
- if the input stream is not a valid document.
nu.xom.ValidityException
- if the input stream is not a valid document.
XProcFilesystem.UnknownSchemeException
- if the scheme in uri
is unknown or not supported.
XProcSecurityException
- if accessing this resource for this operation
is
forbidden by the current setting of XProcSecurityManager
.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).
XProcFilesystem.UnsupportedXMLVersionException
- if the document is in an xml version not supported.
XProcFilesystem.DefectiveURIException
public nu.xom.Document build(java.lang.String textDoc, java.lang.String uri, XProcFilesystem.ParseMode parseMode) throws java.io.IOException, nu.xom.ParsingException, nu.xom.ValidityException, XProcFilesystem.DefectiveURIException
Builds a XOM document from the given String
using the given parseMode
and
with uri
as base uri for the document.
This method should only be used with sources already checked by XProcSecuritySystem
because no security checking is performed here.
textDoc
- the String
with the serialized document.uri
- the base uri for the newly build document.parseMode
- the ParseMode
to use while building the document.
java.io.IOException
- if an error occurred reading the reader
or if no builder
for the parseMode
was found.
nu.xom.ParsingException
- if the reader does not contain a valid document.
nu.xom.ValidityException
- if the reader does not contain a valid document.
XProcFilesystem.DefectiveURIException
public final XProcFilesystem.LoadResult getLoadResult(XProcSecurityManager.Operations operation, java.lang.String href, java.net.URI primaryBase, java.lang.String secondaryBase, java.lang.String contentType, java.lang.String dataWrapper) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcSecurityException, XProcFilesystem.ProtectedResourceException
Returns a LoadResult
obtained from href
made absolute by using
primaryBase
or (if this fails) by secondaryBase
after performing a
security check for the given operation
.
operation
- the Operations
for which the LoadResult
is requested.href
- a uri (fragment) to the resource.primaryBase
- the base uri used to make href
absolute.secondaryBase
- the base uri used to make href
absolute if loading of (href/baseURI)
fails.contentType
- may be used to overwrite the content type of the obtained resource if it is
empty, "application/octet-stream" or "content/unknown". If contentType
is null, the original content type of the resource is used.dataWrapper
- the java class name of the DataWrapper
to use or null. If
dataWrapper
is null, a possible wrapper for the data is determined
using either the extension of the uri or the content type found and the settings
in XProcConfiguration
.
LoadResult
found.
java.io.IOException
- if there is a problem with reading the data on the uri.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcSecurityException
- if accessing this resource for this operation
is
forbidden by the current setting of XProcSecurityManager
.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).public final java.lang.String writeData(XProcSecurityManager.Operations operation, byte[] data, java.net.URI uri) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcSecurityException, XProcFilesystem.ProtectedResourceException
Writes data
to the uri
after a security check for
the given operation
is performed.
operation
- the Operations
for which the data should be written.data
- the data to be written.uri
- the uri to which the data should be written.
java.io.IOException
- if any problem occurs writing the data.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcSecurityException
- if accessing this resource for this operation
is
forbidden by the current setting of XProcSecurityManager
.
XProcFilesystem.ProtectedResourceException
- if the resource with the made uri cannot be accessed
without authentication (HTPP status code 401).protected void writeData(byte[] data, java.net.URI uri) throws XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException, java.io.IOException
Writes data
to the uri
.
This is a low level method called by writeData(Operations, byte[], URI)
You should never call it directly, because there is no security checking in this method. The method is declared protected so you can overwrite it in extending classes to store data to uris where no output stream is available or which need special treatment.
data
- data the data to be written.uri
- the uri to which the data should be written.
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the made uri cannot be accessed
without authentication (HTPP status code 401).
java.io.IOException
- if any problem occurs writing the data.public final java.lang.String[] getDirectoryList(XProcSecurityManager.Operations operation, java.net.URI uri) throws XProcSecurityException, XProcFilesystem.ProtectedResourceException, XProcFilesystem.UnknownSchemeException, java.io.IOException
Gets a list of resource names in the directory named by the uri
after a security check
for the given operation
is performed.
operation
- the Operations
for which the data should be written.uri
- the uri to which the data should be written.
XProcSecurityException
- if accessing this resource for this operation
is
forbidden by the current setting of XProcSecurityManager
.
XProcFilesystem.ProtectedResourceException
- if the resource with the made uri cannot be accessed
without authentication (HTPP status code 401).
XProcFilesystem.UnknownSchemeException
- if the uri's scheme is unknown or not supported.
java.io.IOException
- if any problem occurs reading the directory.public final XProcHttpResponse doHttpRequest(XProcHttpRequest request, com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space) throws java.io.IOException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException, com.xml_project.morganaxproc.core.XProcRuntimeException, XProcFilesystem.UnsupportedMethodException, XProcSecurityException
This method performs a http request by calling abstract method httpRequest(XProcHttpRequest)
or (if this fails) by getting the uri via getInputStream
for method 'get'.
This method work as a bridge between implementations of XProcFilesystem
supporting
httpRequest
and those not supporting it. A not supporting implementation is required
to throw an UnknownSchemaException
. If this occurs and
the method in request
is get, doHttpRequest
will try to make a
XProcHttpResponse
with a response body obtained by calling abstract method
getInputStream
with the uri from request
.
request
- the XProcHttpRequest
to perform.
XProcHttpResponse
to the request
.
java.io.IOException
- if an IOException occurred.
XProcFilesystem.UnknownSchemeException
- if the scheme in the uri is not known or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).
com.xml_project.morganaxproc.core.XProcRuntimeException
- if an XProcRuntimeException
occured while calling
httpRequest
.
XProcFilesystem.UnsupportedMethodException
- if the xml version is not supported.
XProcSecurityException
protected nu.xom.Document getDocument(java.net.URI uri, XProcFilesystem.ParseMode parseMode) throws java.io.IOException, nu.xom.ParsingException, nu.xom.ValidityException, XProcFilesystem.UnknownSchemeException, XProcFilesystem.ProtectedResourceException, XProcFilesystem.DefectiveURIException
Creates a new XOM document by getting an InputStream
via getInputStream
for the given uri
and then building it, using the given parseMode
.
This is a low level method called by loadDocument
. You should never call it directly,
because there is no security checking in this method. (This is done by loadDocument
).
The method is declared protected
so you can overwrite it in extending classes to
return XOM documents which are not available via getInputStream
or come from a
special source (like a document buffer for instance).
uri
- the uri for the document to create.parseMode
- the ParseMode
that must be used to create the document.
java.io.IOException
- if an IOException
occurred obtaining the input stream.
nu.xom.ParsingException
- if the input stream is not a valid document.
nu.xom.ValidityException
- if the input stream is not a valid document.
XProcFilesystem.UnknownSchemeException
- if the scheme in uri
is unknown or not supported.
XProcFilesystem.ProtectedResourceException
- if the resource with the given uri
cannot be obtained
without authentication (HTPP status code 401).
XProcFilesystem.DefectiveURIException
public java.lang.String resolveText(java.net.URI absoluteURI, java.lang.String encoding) throws XPathException
absoluteURI
- encoding
- may be null
javax.xml.xpath.XPathException
XPathException
public 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
org.xml.sax.SAXException
java.io.IOException
public final javax.xml.transform.stream.StreamSource resolveAsStreamSource(java.lang.String href, java.lang.String base, com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space) throws javax.xml.transform.TransformerException
href
- base
-
javax.xml.transform.TransformerException
public final java.util.List<javax.xml.transform.stream.StreamSource> resolveModule(java.lang.String targetNamespace, java.util.List<java.lang.String> locationHints, java.lang.String baseURI)
ModuleURIResolver
resolveModule
in interface ModuleURIResolver
targetNamespace
- the target namespace of the modulelocationHints
- the location hints (if any)baseURI
- the base uri of the importing module
StreamSource
's. May be null, if no modules are found.public final nu.xom.Document loadDocumentFromPackage(XProcSecurityManager.Operations op, java.lang.String href, com.xml_project.morganaxproc.morganapkg.MorganaPKG.UriSpaces space, XProcFilesystem.ParseMode mode) throws nu.xom.ParsingException, XProcFilesystem.DefectiveURIException
op
- - the operation for security checkhref
- - the uri of the componentspace
- - the uri space to look formode
- - the parseMode
nu.xom.ParsingException
XProcFilesystem.DefectiveURIException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |