public class AutoDetectFileFormat
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AutoDetectFileFormat.IsImportableFilter
Filter implementation that filters a collection of
ContextUtil.ContextResult :s by checking each plug-ins ability to
import a given file. |
Constructor and Description |
---|
AutoDetectFileFormat() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
checkImportable(SessionControl sc,
PluginDefinition plugin,
PluginConfiguration config,
File file,
java.lang.String charset,
GuiContext context,
java.lang.Object currentItem) |
static java.util.Map<PluginDefinition,java.util.List<PluginConfiguration>> |
findPlugins(DbControl dc,
GuiContext context,
File file,
java.lang.String charset,
PluginDefinition pluginDef)
Find all plugins with configurations which can import the specified file.
|
public static java.util.Map<PluginDefinition,java.util.List<PluginConfiguration>> findPlugins(DbControl dc, GuiContext context, File file, java.lang.String charset, PluginDefinition pluginDef) throws InvalidDataException, BaseException
AutoDetectingImporter
interface if they can import the specified file.dc
- The DbControl
object to use for database accesscontext
- A required context for the plugins (ie. what items to import)file
- The file to importcharset
- If given, overrides the character set specified by the file
File.getCharacterSet()
pluginDef
- Check only the configurations of this plugin definition, or
null if all plugin definitions should be checkedInvalidDataException
- If the file parameter is null or if
the file isn't located in Location.PRIMARY
storageBaseException
- If there is another errorprivate static boolean checkImportable(SessionControl sc, PluginDefinition plugin, PluginConfiguration config, File file, java.lang.String charset, GuiContext context, java.lang.Object currentItem)