2.8.3: 2008-10-15

net.sf.basedb.util
Class AutoDetectFileFormat

java.lang.Object
  extended by net.sf.basedb.util.AutoDetectFileFormat

public class AutoDetectFileFormat
extends Object

This class has methods for autodetecting file formats.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2008-09-05 17:16:27 +0200 (Fri, 05 Sep 2008) $

Constructor Summary
AutoDetectFileFormat()
           
 
Method Summary
private static boolean checkImportable(SessionControl sc, PluginDefinition plugin, PluginConfiguration config, File file, GuiContext context, Object currentItem)
           
static Map<PluginDefinition,List<PluginConfiguration>> findPlugins(DbControl dc, GuiContext context, File file, PluginDefinition pluginDef)
          Find all plugins with configurations which can import the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoDetectFileFormat

public AutoDetectFileFormat()
Method Detail

findPlugins

public static Map<PluginDefinition,List<PluginConfiguration>> findPlugins(DbControl dc,
                                                                          GuiContext context,
                                                                          File file,
                                                                          PluginDefinition pluginDef)
                                                                   throws InvalidDataException,
                                                                          BaseException
Find all plugins with configurations which can import the specified file. This method will check all plugins implementing the AutoDetectingImporter interface if they can import the specified file.

Parameters:
dc - The DbControl object to use for database access
context - A required context for the plugins (ie. what items to import)
file - The file to import
pluginDef - Check only the configurations of this plugin definition, or null if all plugin definitions should be checked
Returns:
A map which for each plugin definition contains a list of mathching configurations
Throws:
InvalidDataException - If the file parameter is null or if the file isn't located in Location.PRIMARY storage
BaseException - If there is another error

checkImportable

private static boolean checkImportable(SessionControl sc,
                                       PluginDefinition plugin,
                                       PluginConfiguration config,
                                       File file,
                                       GuiContext context,
                                       Object currentItem)

2.8.3: 2008-10-15