Package org.apache.fop.afp
Class AFPStreamer
- java.lang.Object
-
- org.apache.fop.afp.AFPStreamer
-
- All Implemented Interfaces:
Streamable
public class AFPStreamer extends java.lang.Object implements Streamable
Manages the streaming of the AFP output
-
-
Field Summary
Fields Modifier and Type Field Description private DataStream
dataStream
private static java.lang.String
DEFAULT_EXTERNAL_RESOURCE_FILENAME
private java.net.URI
defaultResourceGroupUri
Sets the default resource group file pathprivate Factory
factory
private static org.apache.commons.logging.Log
LOG
Static logging instanceprivate java.io.OutputStream
outputStream
the final outputstreamprivate java.util.Map<java.net.URI,ResourceGroup>
pathResourceGroupMap
A mapping of external resource destinations to resource groupsprivate StreamedResourceGroup
printFileResourceGroup
private InternalResourceResolver
resourceResolver
private static org.apache.xmlgraphics.io.TempResourceURIGenerator
TEMP_URI_GENERATOR
private java.io.OutputStream
tempOutputStream
temporary document outputstreamprivate java.net.URI
tempUri
-
Constructor Summary
Constructors Constructor Description AFPStreamer(Factory factory, InternalResourceResolver resourceResolver)
Main constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes off the AFP stream writing the document streamDataStream
createDataStream(AFPPaintingState paintingState)
Creates a new DataStreamResourceGroup
getResourceGroup(AFPResourceLevel level)
Returns the resource group for a given resource infovoid
setDefaultResourceGroupUri(java.net.URI uri)
Sets the default resource group URI.void
setOutputStream(java.io.OutputStream outputStream)
Sets the final outputstreamvoid
writeToStream(java.io.OutputStream os)
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
Static logging instance
-
DEFAULT_EXTERNAL_RESOURCE_FILENAME
private static final java.lang.String DEFAULT_EXTERNAL_RESOURCE_FILENAME
- See Also:
- Constant Field Values
-
TEMP_URI_GENERATOR
private static final org.apache.xmlgraphics.io.TempResourceURIGenerator TEMP_URI_GENERATOR
-
factory
private final Factory factory
-
resourceResolver
private final InternalResourceResolver resourceResolver
-
pathResourceGroupMap
private final java.util.Map<java.net.URI,ResourceGroup> pathResourceGroupMap
A mapping of external resource destinations to resource groups
-
printFileResourceGroup
private StreamedResourceGroup printFileResourceGroup
-
defaultResourceGroupUri
private java.net.URI defaultResourceGroupUri
Sets the default resource group file path
-
tempUri
private final java.net.URI tempUri
-
tempOutputStream
private java.io.OutputStream tempOutputStream
temporary document outputstream
-
outputStream
private java.io.OutputStream outputStream
the final outputstream
-
dataStream
private DataStream dataStream
-
-
Constructor Detail
-
AFPStreamer
public AFPStreamer(Factory factory, InternalResourceResolver resourceResolver)
Main constructor- Parameters:
factory
- a factoryresourceResolver
- resource resolver
-
-
Method Detail
-
createDataStream
public DataStream createDataStream(AFPPaintingState paintingState) throws java.io.IOException
Creates a new DataStream- Parameters:
paintingState
- the AFP painting state- Returns:
- a new
DataStream
- Throws:
java.io.IOException
- thrown if an I/O exception of some sort has occurred
-
setDefaultResourceGroupUri
public void setDefaultResourceGroupUri(java.net.URI uri)
Sets the default resource group URI.- Parameters:
uri
- the default resource group URI
-
getResourceGroup
public ResourceGroup getResourceGroup(AFPResourceLevel level)
Returns the resource group for a given resource info- Parameters:
level
- a resource level- Returns:
- a resource group for the given resource info
-
close
public void close() throws java.io.IOException
Closes off the AFP stream writing the document stream- Throws:
java.io.IOException
- if an an I/O exception of some sort has occurred
-
setOutputStream
public void setOutputStream(java.io.OutputStream outputStream)
Sets the final outputstream- Parameters:
outputStream
- an outputstream
-
writeToStream
public void writeToStream(java.io.OutputStream os) throws java.io.IOException
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream- Specified by:
writeToStream
in interfaceStreamable
- Parameters:
os
- the outputsteam stream- Throws:
java.io.IOException
- an I/O exception of some sort has occurred.
-
-