Package net.sf.basedb.util.bfs
Class GenericDiskDataWriterFactory<T>
- java.lang.Object
-
- net.sf.basedb.util.bfs.AbstractDataWriterFactory<T>
-
- net.sf.basedb.util.bfs.GenericDiskDataWriterFactory<T>
-
- All Implemented Interfaces:
DataWriterFactory<T>
public class GenericDiskDataWriterFactory<T> extends AbstractDataWriterFactory<T>
Generic implementation of a data writer factory that create files on the local file system. The default file name generation will generate file names of the form 'sdata-1.txt', 'sdata-2.txt', and so on.- Version:
- 2.15
- Author:
- Nicklas
- Last modified
- $Date: 2010-01-12 14:21:49 +0100 (ti, 12 jan 2010) $
-
-
Constructor Summary
Constructors Constructor Description GenericDiskDataWriterFactory(File dir, FilenameGenerator<T> filenameGenerator)
Create a new factory that creates files in the given directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected OutputStream
getOutputStream(String filename)
Create a new file in the data directory with the given file name.-
Methods inherited from class net.sf.basedb.util.bfs.AbstractDataWriterFactory
createDataWriter, isUnique
-
-
-
-
Field Detail
-
dir
private final File dir
-
-
Constructor Detail
-
GenericDiskDataWriterFactory
public GenericDiskDataWriterFactory(File dir, FilenameGenerator<T> filenameGenerator) throws IOException
Create a new factory that creates files in the given directory. The directory should already exist.- Parameters:
dir
- The directory to create files in- Throws:
NullPointerException
- If the dir parameter is nullFileNotFoundException
- If the given path is not an existing directoryIOException
-
-
Method Detail
-
getOutputStream
protected OutputStream getOutputStream(String filename) throws IOException
Create a new file in the data directory with the given file name.- Specified by:
getOutputStream
in classAbstractDataWriterFactory<T>
- Throws:
IOException
- If the file already exists or if it can't be created
-
-