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