public class Any23PluginManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CLI_PACKAGE
Any23 Command Line Interface package.
|
static String |
PLUGIN_DIRS_LIST_SEPARATOR
List separator for the string declaring the plugin list.
|
static String |
PLUGIN_DIRS_PROPERTY
Property where look for plugins.
|
| Modifier and Type | Method and Description |
|---|---|
ExtractorGroup |
configureExtractors(ExtractorGroup initialExtractorGroup)
Configures a new list of extractors containing the extractors declared in
initialExtractorGroup
and also the extractors detected in classpath specified by the default configuration. |
ExtractorGroup |
configureExtractors(File... pluginLocations)
Configures a new list of extractors containing the extractors declared in
initialExtractorGroup
and also the extractors detected in classpath specified by pluginLocations. |
ExtractorGroup |
getApplicableExtractors(ExtractorRegistry registry,
File... pluginLocations)
Returns an extractor group containing both the default extractors declared by the
ExtractorRegistry and the ExtractorPlugins. |
Iterator<Tool> |
getApplicableTools(File... pluginLocations)
Returns an
Iterator of tools that have been detected within the given list of locations. |
Iterator<ExtractorFactory> |
getExtractors()
List of
ExtractorPlugin classes declared within the classpath. |
static Any23PluginManager |
getInstance() |
<T> Iterator<T> |
getPlugins(Class<T> type)
Returns all classes within the specified
packageName satisfying the given class
filter. |
Iterator<Tool> |
getTools()
Returns the list of all the
Tool classes declared within the classpath. |
boolean |
loadClassDir(File classDir)
Loads a classes directory in the classpath.
|
Throwable[] |
loadClassDirs(File... classDirs)
Loads a list of class dirs in the classpath.
|
Throwable[] |
loadFiles(File... files)
Loads a generic list of files, trying to determine the type of every file.
|
boolean |
loadJAR(File jar)
Loads a JAR file in the classpath.
|
boolean |
loadJARDir(File jarDir)
Loads all the JARs detected in a given directory.
|
Throwable[] |
loadJARs(File... jars)
Loads a list of JARs in the classpath.
|
String |
loadPlugins(File... pluginLocations)
Loads plugins from a list of specified locations.
|
public static final String CLI_PACKAGE
public static final String PLUGIN_DIRS_PROPERTY
public static final String PLUGIN_DIRS_LIST_SEPARATOR
public static Any23PluginManager getInstance()
Any23PluginManager.public boolean loadJAR(File jar)
jar - the JAR file to be loaded.true if the JAR is added for the first time to the classpath,
false otherwise.MalformedURLExceptionpublic Throwable[] loadJARs(File... jars)
jars - list of JARs to be loaded.public boolean loadClassDir(File classDir)
classDir - the directory to be loaded.true if the directory is added for the first time to the classpath,
false otherwise.public Throwable[] loadClassDirs(File... classDirs)
classDirs - list of class dirs to be loaded.public boolean loadJARDir(File jarDir)
jarDir - directory containing the JARs to be loaded.true if all JARs in dir are loaded.public Throwable[] loadFiles(File... files)
files - list of files to be loaded.public <T> Iterator<T> getPlugins(Class<T> type) throws IOException
packageName satisfying the given class
filter. The search is performed on the static classpath (the one the application
started with) and the dynamic classpath (the one specified using the load methods).T - type of filtered class.IOExceptionpublic Iterator<Tool> getTools() throws IOException
Tool classes declared within the classpath.null list of tool classes.IOExceptionpublic Iterator<ExtractorFactory> getExtractors() throws IOException
ExtractorPlugin classes declared within the classpath.null list of plugin classes.IOExceptionpublic String loadPlugins(File... pluginLocations)
pluginLocations - list of locations.public ExtractorGroup configureExtractors(File... pluginLocations) throws IOException, IllegalAccessException, InstantiationException
initialExtractorGroup
and also the extractors detected in classpath specified by pluginLocations.pluginLocations - IOExceptionIllegalAccessExceptionInstantiationExceptionpublic ExtractorGroup configureExtractors(ExtractorGroup initialExtractorGroup) throws IOException, InstantiationException, IllegalAccessException
initialExtractorGroup
and also the extractors detected in classpath specified by the default configuration.initialExtractorGroup - initial list of extractors.IOExceptionInstantiationExceptionIllegalAccessExceptionpublic ExtractorGroup getApplicableExtractors(ExtractorRegistry registry, File... pluginLocations) throws IOException, IllegalAccessException, InstantiationException
ExtractorRegistry and the ExtractorPlugins.registry - TODOpluginLocations - optional list of plugin locations.null and not empty extractor group.IOExceptionIllegalAccessExceptionInstantiationExceptionpublic Iterator<Tool> getApplicableTools(File... pluginLocations) throws IOException
Iterator of tools that have been detected within the given list of locations.pluginLocations - list of plugin locations.IOExceptionCopyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.