public class MultipleFilesOutput extends Object implements StreamFactory
Modifier and Type | Field and Description |
---|---|
private File |
basename
Base file name.
|
private static String |
EXTENSION
File name extension.
|
private static String |
GZIP_EXTENSION
GZip extra file extension
|
private static Logging |
LOG
Logger for debugging.
|
private boolean |
usegzip
Control gzip compression of output.
|
Constructor and Description |
---|
MultipleFilesOutput(File base)
Constructor
|
MultipleFilesOutput(File base,
boolean gzip)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
closeStream(PrintStream stream)
Close the given output stream (Note: when writing to a single stream
output, it will actually not be closed!)
|
protected boolean |
isGzipCompression()
Get GZIP compression flag.
|
private PrintStream |
newStream(String name)
Open a new stream of the given name
|
PrintStream |
openStream(String filename)
Retrieve the output stream for the given file name.
|
protected void |
setGzipCompression(boolean usegzip)
Set GZIP compression flag.
|
private static final String EXTENSION
private static final String GZIP_EXTENSION
private File basename
private boolean usegzip
private static final Logging LOG
public MultipleFilesOutput(File base)
base
- Base file name (folder name)public MultipleFilesOutput(File base, boolean gzip)
base
- Base file name (folder name)gzip
- Use gzip compression.private PrintStream newStream(String name) throws IOException
name
- file name (which will be appended to the base name)IOException
public PrintStream openStream(String filename) throws IOException
openStream
in interface StreamFactory
filename
- Output label.IOException
- on IO errorpublic void closeStream(PrintStream stream)
StreamFactory
closeStream
in interface StreamFactory
stream
- Stream to closeprotected boolean isGzipCompression()
protected void setGzipCompression(boolean usegzip)
usegzip
- use GZIP compression