public class FilteredDataEntryWriter extends Object implements DataEntryWriter
| Constructor and Description |
|---|
FilteredDataEntryWriter(DataEntryFilter dataEntryFilter,
DataEntryWriter acceptedDataEntryWriter)
Creates a new FilteredDataEntryWriter with only a writer for accepted
data entries.
|
FilteredDataEntryWriter(DataEntryFilter dataEntryFilter,
DataEntryWriter acceptedDataEntryWriter,
DataEntryWriter rejectedDataEntryWriter)
Creates a new FilteredDataEntryWriter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Finishes writing all data entries.
|
boolean |
createDirectory(DataEntry dataEntry)
Creates a directory.
|
OutputStream |
getOutputStream(DataEntry dataEntry)
Returns an output stream for writing data.
|
OutputStream |
getOutputStream(DataEntry dataEntry,
Finisher finisher)
Returns an output stream for writing data.
|
public FilteredDataEntryWriter(DataEntryFilter dataEntryFilter, DataEntryWriter acceptedDataEntryWriter)
dataEntryFilter - the data entry filter.acceptedDataEntryWriter - the DataEntryWriter to which the writing
will be delegated if the filter accepts
the data entry. May be null.public FilteredDataEntryWriter(DataEntryFilter dataEntryFilter, DataEntryWriter acceptedDataEntryWriter, DataEntryWriter rejectedDataEntryWriter)
dataEntryFilter - the data entry filter.acceptedDataEntryWriter - the DataEntryWriter to which the writing
will be delegated if the filter accepts
the data entry. May be null.rejectedDataEntryWriter - the DataEntryWriter to which the writing
will be delegated if the filter does not
accept the data entry. May be
null.public boolean createDirectory(DataEntry dataEntry) throws IOException
DataEntryWritercreateDirectory in interface DataEntryWriterdataEntry - the data entry for which the directory is to be created.IOExceptionpublic OutputStream getOutputStream(DataEntry dataEntry) throws IOException
DataEntryWritergetOutputStream in interface DataEntryWriterdataEntry - the data entry for which the output stream is to be created.null to indicate
that the data entry should not be written.IOExceptionpublic OutputStream getOutputStream(DataEntry dataEntry, Finisher finisher) throws IOException
DataEntryWritergetOutputStream in interface DataEntryWriterdataEntry - the data entry for which the output stream is to be created.finisher - the optional finisher that will be called before this
class closes the output stream (at some later point in
time) that will be returned (now).null to indicate
that the data entry should not be written.IOExceptionpublic void close()
throws IOException
DataEntryWriterclose in interface DataEntryWriterIOExceptionCopyright © 2015. All Rights Reserved.