|
|||||||||
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 com.xml_project.morganaxproc.filesystem.AlternateFilesystem com.xml_project.morganaxproc.filesystem.DefaultFilesystem
public class DefaultFilesystem
This class provides an implementation for XProcFilesystem
that support all required
methods for 'file:', 'http:' and 'https:' and supports also sending http requests by using
p:http-request. The basis functionally is provided by extending AlternateFileSystem
while support for p:http-request is provided in this class.
Since this class heavily depends on Apache's Commons HttpClient(TM), you have to have the related
jar-files on your class path. If you do not need support for p:http-request and/or do not want to
have the Apache-classes on the class path, just switch to AlternateFilesystem
as default in your configuration of MorganaXProc
. The Apache jar files needed are:
Availabe at: https://hc.apache.org/httpcomponents-client-ga/
Used licence: Apache License, Version 2.0
Nested Class Summary | |
---|---|
static class |
DefaultFilesystem.REDIRECTION_STRATEGY
An enumeration of the possible redirection strategies. |
Nested classes/interfaces inherited from class com.xml_project.morganaxproc.filesystem.XProcFilesystem |
---|
XProcFilesystem.DefectiveURIException, XProcFilesystem.LoadResult, XProcFilesystem.ParseMode, XProcFilesystem.ProtectedResourceException, XProcFilesystem.StreamResult, XProcFilesystem.UnknownSchemeException, XProcFilesystem.UnsupportedMethodException, XProcFilesystem.UnsupportedXMLVersionException |
Field Summary | |
---|---|
static java.lang.String |
ContentTypeHeader
|
Fields inherited from class com.xml_project.morganaxproc.filesystem.XProcFilesystem |
---|
DIRECTORY_MARKER, theConfig |
Constructor Summary | |
---|---|
DefaultFilesystem(XProcConfiguration config)
Create a new DefaultFilesystem with redirection strategy 'default'. |
|
DefaultFilesystem(XProcConfiguration config,
org.apache.http.impl.client.CloseableHttpClient httpClient,
DefaultFilesystem.REDIRECTION_STRATEGY strategy)
Creates a new DefaultFilesystem with the given XProcConfiguration |
|
DefaultFilesystem(XProcConfiguration config,
DefaultFilesystem.REDIRECTION_STRATEGY strategy)
Creates a new DefaultFilesystem with the given redirection strategy. |
Method Summary | |
---|---|
protected void |
clearCookieStore()
Clears the cookie storage associated with the instance of this class |
protected XProcHttpResponse |
httpRequest(XProcHttpRequest request)
Performs a http request for uri schemes 'http:' and 'https'. |
Methods inherited from class com.xml_project.morganaxproc.filesystem.AlternateFilesystem |
---|
copyResource, createDirectory, createTemp, deleteResource, getContentType, getDirectoryList, getEncoding, getInputStream, getOutputStream, getResourceInfo, moveResource, touchResource |
Methods inherited from class com.xml_project.morganaxproc.filesystem.XProcFilesystem |
---|
build, copy, copyResourceChecked, createDirectoryChecked, createTempChecked, deleteResourceChecked, doHttpRequest, getAsStreamSource, getDirectoryList, getDocument, getLoadResult, getResourceInfoChecked, loadDocument, loadDocument, loadDocumentFromPackage, moveResourceChecked, resolveAsStreamSource, resolveCollection, resolveEntity, resolveModule, resolveText, resolveURI, touchResourceChecked, writeData, writeData |
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 ContentTypeHeader
Constructor Detail |
---|
public DefaultFilesystem(XProcConfiguration config) throws java.lang.ClassNotFoundException
DefaultFilesystem
with redirection strategy 'default'. See explanation for
DefaultFileSystem(XProcConfiguration, CloseableHttpClient REDIRECTION_STRATEGY)
- Parameters:
config
- the configuration
- Throws:
java.lang.ClassNotFoundException
- if any of classes necessary not found, especially if one of the
classes of Apache package is not available on the class path.
public DefaultFilesystem(XProcConfiguration config, DefaultFilesystem.REDIRECTION_STRATEGY strategy) throws java.lang.ClassNotFoundException
DefaultFilesystem
with the given redirection strategy. See explanation for
DefaultFileSystem(XProcConfiguration, CloseableHttpClient REDIRECTION_STRATEGY)
- Parameters:
config
- the configurationstrategy
- the redirection strategy to use.
- Throws:
java.lang.ClassNotFoundException
- if any of classes necessary not found, especially if one of the
classes of Apache package is not available on the class path.
public DefaultFilesystem(XProcConfiguration config, org.apache.http.impl.client.CloseableHttpClient httpClient, DefaultFilesystem.REDIRECTION_STRATEGY strategy) throws java.lang.ClassNotFoundException
DefaultFilesystem
with the given XProcConfiguration. If
httpClient
is null, a new one is created, otherwise the provided client is used. If
creation fails, a ClassNotFoundException
is thrown. This will cause MorganaXProc
to switch back to an alternative file system, which usally is AlternateFilesystem
.
- Parameters:
config
- the XProcConfiguration
to use.httpClient
- a CloseableHttpClient
or null to create a new one.strategy
- the redirection strategy to use.
- Throws:
java.lang.ClassNotFoundException
- if any of classes necessary not found, especially if one of the
classes of Apache package is not available on the class path.
Method Detail |
---|
protected void clearCookieStore()
clearCookieStore
in class AlternateFilesystem
protected XProcHttpResponse httpRequest(XProcHttpRequest request) throws java.io.IOException, XProcFilesystem.UnknownSchemeException
httpRequest
in class AlternateFilesystem
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |