net.sf.basedb.util
Class AutoDetectFileFormat
java.lang.Object
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) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AutoDetectFileFormat
public AutoDetectFileFormat()
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 accesscontext
- A required context for the plugins (ie. what items to import)file
- The file to importpluginDef
- 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)