|
|
@ -16,7 +16,6 @@ import java.io.File; |
|
|
|
import java.io.FileFilter; |
|
|
|
import java.io.FileFilter; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
@ -273,18 +272,17 @@ public class DefaultPluginManager implements PluginManager { |
|
|
|
filterList.add(new NotFileFilter(createHiddenPluginFilter())); |
|
|
|
filterList.add(new NotFileFilter(createHiddenPluginFilter())); |
|
|
|
FileFilter pluginsFilter = new AndFileFilter(filterList); |
|
|
|
FileFilter pluginsFilter = new AndFileFilter(filterList); |
|
|
|
File[] directories = pluginsDirectory.listFiles(pluginsFilter); |
|
|
|
File[] directories = pluginsDirectory.listFiles(pluginsFilter); |
|
|
|
List<File> dirArray = new ArrayList<File>(); |
|
|
|
if (directories == null) { |
|
|
|
if (directories != null) { |
|
|
|
directories = new File[0]; |
|
|
|
dirArray.addAll(Arrays.asList(directories)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
log.debug("Found possible {} plugins: {}", dirArray.size(), dirArray); |
|
|
|
log.debug("Found possible {} plugins: {}", directories.length, directories); |
|
|
|
if (dirArray.size() == 0) { |
|
|
|
if (directories.length == 0) { |
|
|
|
log.info("No plugins"); |
|
|
|
log.info("No plugins"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// load any plugin from plugins directory
|
|
|
|
// load any plugin from plugins directory
|
|
|
|
for (File directory : dirArray) { |
|
|
|
for (File directory : directories) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
loadPlugin(directory); |
|
|
|
loadPlugin(directory); |
|
|
|
} catch (PluginException e) { |
|
|
|
} catch (PluginException e) { |
|
|
@ -348,12 +346,12 @@ public class DefaultPluginManager implements PluginManager { |
|
|
|
PluginState state = stopPlugin(pluginId); |
|
|
|
PluginState state = stopPlugin(pluginId); |
|
|
|
|
|
|
|
|
|
|
|
if (PluginState.STOPPED != state) { |
|
|
|
if (PluginState.STOPPED != state) { |
|
|
|
log.error(String.format("Failed to stop plugin %s on delete", pluginId)); |
|
|
|
log.error("Failed to stop plugin {} on delete", pluginId); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!unloadPlugin(pluginId)) { |
|
|
|
if (!unloadPlugin(pluginId)) { |
|
|
|
log.error(String.format("Failed to unload plugin %s on delete", pluginId)); |
|
|
|
log.error("Failed to unload plugin {} on delete", pluginId); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|