public class MultipleFilesOutput extends java.lang.Object implements StreamFactory
Modifier and Type | Field and Description |
---|---|
private java.io.File |
basename
Base file name.
|
private static java.lang.String |
EXTENSION
File name extension.
|
private static java.lang.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(java.io.File base)
Constructor
|
MultipleFilesOutput(java.io.File base,
boolean gzip)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close stream factory.
|
void |
closeStream(java.io.PrintStream stream)
Close the given output stream (Note: when writing to a single stream
output, it will actually not be closed!)
|
private java.io.PrintStream |
newStream(java.lang.String name)
Open a new stream of the given name
|
java.io.PrintStream |
openStream(java.lang.String filename)
Retrieve the output stream for the given file name.
|
private static final java.lang.String EXTENSION
private static final java.lang.String GZIP_EXTENSION
private java.io.File basename
private boolean usegzip
private static final Logging LOG
public MultipleFilesOutput(java.io.File base)
base
- Base file name (folder name)public MultipleFilesOutput(java.io.File base, boolean gzip)
base
- Base file name (folder name)gzip
- Use gzip compression.private java.io.PrintStream newStream(java.lang.String name) throws java.io.IOException
name
- file name (which will be appended to the base name)java.io.IOException
public java.io.PrintStream openStream(java.lang.String filename) throws java.io.IOException
openStream
in interface StreamFactory
filename
- Output label.java.io.IOException
- on IO errorpublic void closeStream(java.io.PrintStream stream)
StreamFactory
closeStream
in interface StreamFactory
stream
- Stream to closepublic void close() throws java.io.IOException
StreamFactory
close
in interface StreamFactory
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2019 ELKI Development Team. License information.