public class OutputProxy
extends java.lang.Object
Special feature: You can request "substreams", which logically belong to the main stream this Proxy stands for, but which are directed to different end points (files or streams). Not yet implemented (will use OutputStreamFactory).
Constructor and Description |
---|
OutputProxy()
zero-arg constructor
|
OutputProxy(DiskFile file)
Constructor for InputProxy with a DiskFile as parameter.
|
OutputProxy(java.io.OutputStream byteStream)
Create a new output with a byte stream.
|
OutputProxy(java.lang.String systemId)
Create a new output with a system identifier.
|
OutputProxy(java.io.Writer characterStream)
Create a new output with a character stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close the proxy.
|
static void |
close(java.io.Writer writer,
java.io.OutputStream outstream,
LogSource aLogger)
Static version of the elaborate close() methof for an OutputProxy.
|
void |
flush()
flush unwritten content
|
java.io.OutputStream |
getByteStream(boolean doThrow)
Get the byte stream for this output.
|
java.io.Writer |
getCharacterStream(boolean doThrow)
Returns the Reader.
|
java.io.Writer |
getCharacterStream(java.lang.String enc)
Returns a reader with the specified encoding
|
java.lang.String |
getEncoding()
Get the character encoding for a byte stream or URI.
|
java.lang.String |
getPublicId()
Get the public identifier for this object.
|
java.lang.String |
getSystemId()
Get the system identifier for this output.
|
java.lang.String |
getSystemIdLocalFormat()
Get the system identifier for this output, in local file system format.
|
java.lang.String |
getSystemIdName()
Returns the name portion to the systemId (i.e. it discards the path up to the file name
|
java.lang.String |
getSystemIdPath()
returns the path portion to the systemId (i.e. it truncates the actual file name,
and includes the trailing '/'.
|
boolean |
isOpen()
checks if the stream is still open.
|
protected void |
makeOutputProxyFromSystemID(java.lang.String systemId) |
void |
open(boolean doThrow)
Opens the object for output.
|
void |
setByteStream(java.io.OutputStream byteStream)
Set the byte stream for this output.
|
void |
setCharacterStream(java.io.Writer characterStream)
Set the character stream for this output.
|
void |
setEncoding(java.lang.String encoding)
Set the character encoding, if known.
|
void |
setPublicId(java.lang.String publicId)
Set the public identifier for this output.
|
void |
setSystemId(java.lang.String systemId)
Set the system identifier for this output.
|
java.lang.String |
toString()
For debugging
|
public OutputProxy(DiskFile file)
public OutputProxy()
public OutputProxy(java.lang.String systemId)
public OutputProxy(java.io.OutputStream byteStream)
public OutputProxy(java.io.Writer characterStream)
protected void makeOutputProxyFromSystemID(java.lang.String systemId)
public void setPublicId(java.lang.String publicId)
public java.lang.String getPublicId()
public void setSystemId(java.lang.String systemId)
systemId
- The system identifier as a string.public java.lang.String getSystemId()
setSystemId(java.lang.String)
,
getEncoding()
public java.lang.String getSystemIdLocalFormat()
setSystemId(java.lang.String)
,
getEncoding()
public void setByteStream(java.io.OutputStream byteStream)
byteStream
- A byte stream containing an XML document or
other entity.public java.io.OutputStream getByteStream(boolean doThrow) throws java.lang.Exception
The getEncoding method will return the character encoding for this byte stream, or null if unknown.
doThrow
- if true, an error result in throwing an appropriate Exception, otherwise simply null is returnedjava.lang.Exception
public void setEncoding(java.lang.String encoding)
encoding
- A string describing the character encoding.public java.lang.String getEncoding()
public void setCharacterStream(java.io.Writer characterStream)
characterStream
- The character stream containing the
XML document or other entity.public java.io.Writer getCharacterStream(boolean doThrow) throws java.lang.Exception
doThrow
- if true, an error result in throwing an appropriate Exception, otherwise simply null is returnedjava.lang.Exception
public java.io.Writer getCharacterStream(java.lang.String enc) throws java.io.UnsupportedEncodingException, java.lang.Exception
java.io.UnsupportedEncodingException
java.lang.Exception
public java.lang.String getSystemIdPath()
public java.lang.String getSystemIdName()
public void open(boolean doThrow) throws java.lang.Exception
doThrow
- if true, an error result in throwing an appropriate Exceptionjava.lang.Exception
public void close()
public static void close(java.io.Writer writer, java.io.OutputStream outstream, LogSource aLogger)
writer
- outstream
- public void flush()
public boolean isOpen()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()