Commit 7362d516 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed support of mixed-case plugins on Linux/Unix.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1755 b35dd754-fafc-0310-a699-88a17e54d16e
parent a7be44bb
...@@ -520,7 +520,7 @@ public class PluginManager { ...@@ -520,7 +520,7 @@ public class PluginManager {
public void run() { public void run() {
try { try {
// look for plugin directories specified as a system property // Look for extra plugin directories specified as a system property.
String pluginDirs = System.getProperty("pluginDirs"); String pluginDirs = System.getProperty("pluginDirs");
if (pluginDirs != null) { if (pluginDirs != null) {
StringTokenizer st = new StringTokenizer(pluginDirs, ", "); StringTokenizer st = new StringTokenizer(pluginDirs, ", ");
...@@ -540,7 +540,7 @@ public class PluginManager { ...@@ -540,7 +540,7 @@ public class PluginManager {
} }
}); });
if(jars == null){ if (jars == null) {
return; return;
} }
...@@ -593,6 +593,12 @@ public class PluginManager { ...@@ -593,6 +593,12 @@ public class PluginManager {
} }
}); });
// Turn the list of JAR/WAR files into a set so that we can do lookups.
Set<String> jarSet = new HashSet<String>();
for (File file : jars) {
jarSet.add(file.getName().toLowerCase());
}
// See if any currently running plugins need to be unloaded // See if any currently running plugins need to be unloaded
// due to the JAR file being deleted (ignore admin plugin). // due to the JAR file being deleted (ignore admin plugin).
// Build a list of plugins to delete first so that the plugins // Build a list of plugins to delete first so that the plugins
...@@ -603,10 +609,8 @@ public class PluginManager { ...@@ -603,10 +609,8 @@ public class PluginManager {
if (pluginName.equals("admin")) { if (pluginName.equals("admin")) {
continue; continue;
} }
File file = new File(pluginDirectory, pluginName + ".jar"); if (!jarSet.contains(pluginName + ".jar")) {
if (!file.exists()) { if (!jarSet.contains(pluginName + ".war")) {
file = new File(pluginDirectory, pluginName + ".war");
if (!file.exists()) {
toDelete.add(pluginName); toDelete.add(pluginName);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment