* Plugins:

- Enforce min and max Jetty versions at plugin installation
    - Enforce I2P, Java, and Jetty versions at plugin startup too
This commit is contained in:
zzz
2011-12-24 00:48:30 +00:00
parent 8fa720539a
commit bb7a88ffc9
3 changed files with 66 additions and 6 deletions

View File

@@ -334,6 +334,21 @@ public class PluginUpdateHandler extends UpdateHandler {
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
return;
}
oldVersion = LogsHelper.jettyVersion();
minVersion = ConfigClientsHelper.stripHTML(props, "min-jetty-version");
if (minVersion != null &&
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
to.delete();
statusDone("<b>" + _("Plugin requires Jetty version {0} or higher", minVersion) + "</b>");
return;
}
maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version");
if (maxVersion != null &&
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
to.delete();
statusDone("<b>" + _("Plugin requires Jetty version {0} or lower", maxVersion) + "</b>");
return;
}
// check if it is running first?
try {