Package net.sf.basedb.util.bfs
Class GenericExtraFileImporter
- java.lang.Object
-
- net.sf.basedb.util.bfs.GenericExtraFileImporter
-
- All Implemented Interfaces:
ExtraFileImporter
public class GenericExtraFileImporter extends Object implements ExtraFileImporter
Extra file importer implementation that imports file to a specified directory in the BASE file system. Files that already exists can be overwritten or ignored. Files that already exists and have their removed flag set are always overwritten.- Since:
- 2.15
- Author:
- Nicklas
- Last modified
- $Date: 2010-02-09 11:45:56 +0100 (ti, 09 feb 2010) $
-
-
Constructor Summary
Constructors Constructor Description GenericExtraFileImporter(DbControl dc, Directory dir, boolean overwrite)
Create a new extra file importer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
importExtraFile(String filename, InputStreamLocator locator)
Import the file data into a file in the BASE file system.
-
-
-
Constructor Detail
-
GenericExtraFileImporter
public GenericExtraFileImporter(DbControl dc, Directory dir, boolean overwrite)
Create a new extra file importer.- Parameters:
dc
- A DbControl to use for database accessdir
- The directory in the BASE file system where the imported files should be placedoverwrite
- TRUE to force overwriting existing files, FALSE to only overwrite files that have been marked for removal
-
-
Method Detail
-
importExtraFile
public File importExtraFile(String filename, InputStreamLocator locator) throws IOException
Description copied from interface:ExtraFileImporter
Import the file data into a file in the BASE file system. TheBfsImporter
will call this method once for each extra file (entries starting with 'x-') in the metadata file. The implementation is supposed to create a file in the BASE file system or link to an existing file. The returned file will be automatically linked with the child bioassay set.- Specified by:
importExtraFile
in interfaceExtraFileImporter
- Parameters:
filename
- The filename of the file that is being importedlocator
- A locator implementation that should be used to find the file data if needed- Returns:
- The file in the BASE file system or null if no file was created
- Throws:
IOException
- If there is a problem reading the file data
-
-