public class ExportOutputStream extends 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 OutputStream |
out |
Constructor and Description |
---|
ExportOutputStream(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(String charset)
Do nothing should be overridden by subclasses.
|
void |
setContentLength(long contentLength)
Do nothing.
|
void |
setFilename(String name)
Do nothing.
|
void |
setMimeType(String mimeType)
Do nothing.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
private final OutputStream out
public ExportOutputStream(OutputStream out)
out
- The underlying stream to write the exported data toNullPointerException
- If out is nullpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void setContentLength(long contentLength)
public void setMimeType(String mimeType)
public void setCharacterSet(String charset)
public void setFilename(String name)