2.17.2: 2011-06-17

Class GenericExtraFileImporter

  extended by net.sf.basedb.util.bfs.GenericExtraFileImporter
All Implemented Interfaces:

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.

Last modified
$Date: 2010-02-09 11:45:56 +0100 (Tue, 09 Feb 2010) $

Field Summary
private  DbControl dc
private  Directory dir
private  boolean overwrite
Constructor Summary
GenericExtraFileImporter(DbControl dc, Directory dir, boolean overwrite)
          Create a new extra file importer.
Method Summary
 File importExtraFile(String filename, InputStreamLocator locator)
          Import the file data into a file in the BASE file system.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private final DbControl dc


private final Directory dir


private final boolean overwrite
Constructor Detail


public GenericExtraFileImporter(DbControl dc,
                                Directory dir,
                                boolean overwrite)
Create a new extra file importer.

dc - A DbControl to use for database access
dir - The directory in the BASE file system where the imported files should be placed
overwrite - TRUE to force overwriting existing files, FALSE to only overwrite files that have been marked for removal
Method Detail


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. The BfsImporter 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 interface ExtraFileImporter
filename - The filename of the file that is being imported
locator - A locator implementation that should be used to find the file data if needed
The file in the BASE file system or null if no file was created
IOException - If there is a problem reading the file data

2.17.2: 2011-06-17