public class ExportOutputStream
extends java.io.OutputStream
ImmediateDownloadExporter
interface. If the plugin
wants to set mime type, character set, content length and filename it must do
so before it starts writing data to the output stream.
This class is intended to be subclassed by implementations more
suitable for the type of download. For example the ServletExportOutputStream
implements direct download
from web clients and the FileExportOutputStream
implements
direct download to the BASE file system.
Modifier and Type | Field and Description |
---|---|
private java.io.OutputStream |
out |
Constructor and Description |
---|
ExportOutputStream(java.io.OutputStream out)
Create a new export stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
File |
getFile()
If the export stream is going to a BASE
File object,
use this method to access it. |
void |
setCharacterSet(java.lang.String charset)
Do nothing should be overridden by subclasses.
|
void |
setContentLength(long contentLength)
Do nothing.
|
void |
setFilename(java.lang.String name)
Do nothing.
|
void |
setMimeType(java.lang.String mimeType)
Do nothing.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public ExportOutputStream(java.io.OutputStream out)
out
- The underlying stream to write the exported data tojava.lang.NullPointerException
- If out is nullpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void setContentLength(long contentLength)
public void setMimeType(java.lang.String mimeType)
public void setCharacterSet(java.lang.String charset)
public void setFilename(java.lang.String name)