Changeset bb7a88f
- Timestamp:
- Dec 24, 2011 12:48:30 AM (9 years ago)
- Branches:
- master
- Children:
- 87008f3
- Parents:
- 8fa7205
- Location:
- apps/routerconsole/java/src/net/i2p/router/web
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java
r8fa7205 rbb7a88f 13 13 /** @since 0.8.11 */ 14 14 public String getJettyVersion() { 15 return Version.getImplVersion(); 15 return jettyVersion(); 16 } 17 18 /** @since 0.8.13 */ 19 static String jettyVersion() { 20 try { 21 return Version.getImplVersion(); 22 } catch (Throwable t) { 23 return "unknown"; 24 } 16 25 } 17 26 -
apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java
r8fa7205 rbb7a88f 18 18 import java.util.concurrent.ConcurrentHashMap; 19 19 20 import net.i2p.CoreVersion; 20 21 import net.i2p.I2PAppContext; 21 22 import net.i2p.data.DataHelper; … … 28 29 import net.i2p.util.Log; 29 30 import net.i2p.util.Translate; 31 import net.i2p.util.VersionComparator; 30 32 31 33 import org.mortbay.jetty.Server; … … 96 98 return false; 97 99 } 100 101 Properties props = pluginProperties(ctx, appName); 102 String minVersion = ConfigClientsHelper.stripHTML(props, "min-i2p-version"); 103 if (minVersion != null && 104 (new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) { 105 String foo = "Plugin " + appName + " requires I2P version " + minVersion + " or higher"; 106 log.error(foo); 107 throw new Exception(foo); 108 } 109 110 minVersion = ConfigClientsHelper.stripHTML(props, "min-java-version"); 111 if (minVersion != null && 112 (new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) { 113 String foo = "Plugin " + appName + " requires Java version " + minVersion + " or higher"; 114 log.error(foo); 115 throw new Exception(foo); 116 } 117 118 String jVersion = LogsHelper.jettyVersion(); 119 minVersion = ConfigClientsHelper.stripHTML(props, "min-jetty-version"); 120 if (minVersion != null && 121 (new VersionComparator()).compare(minVersion, jVersion) > 0) { 122 String foo = "Plugin " + appName + " requires Jetty version " + minVersion + " or higher"; 123 log.error(foo); 124 throw new Exception(foo); 125 } 126 127 String maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version"); 128 if (maxVersion != null && 129 (new VersionComparator()).compare(maxVersion, jVersion) < 0) { 130 String foo = "Plugin " + appName + " requires Jetty version " + maxVersion + " or lower"; 131 log.error(foo); 132 throw new Exception(foo); 133 } 134 98 135 if (log.shouldLog(Log.INFO)) 99 136 log.info("Starting plugin: " + appName); … … 114 151 File clientConfig = new File(pluginDir, "clients.config"); 115 152 if (clientConfig.exists()) { 116 Properties props = new Properties();117 DataHelper.loadProps( props, clientConfig);153 Properties cprops = new Properties(); 154 DataHelper.loadProps(cprops, clientConfig); 118 155 List<ClientAppConfig> clients = ClientAppConfig.getClientApps(clientConfig); 119 156 runClientApps(ctx, pluginDir, clients, "start"); … … 124 161 if (server != null) { 125 162 File consoleDir = new File(pluginDir, "console"); 126 Properties props = RouterConsoleRunner.webAppProperties(consoleDir.getAbsolutePath());163 Properties wprops = RouterConsoleRunner.webAppProperties(consoleDir.getAbsolutePath()); 127 164 File webappDir = new File(consoleDir, "webapps"); 128 165 String fileNames[] = webappDir.list(RouterConsoleRunner.WarFilenameFilter.instance()); … … 139 176 continue; 140 177 } 141 String enabled = props.getProperty(RouterConsoleRunner.PREFIX + warName + ENABLED);178 String enabled = wprops.getProperty(RouterConsoleRunner.PREFIX + warName + ENABLED); 142 179 if (! "false".equals(enabled)) { 143 180 if (log.shouldLog(Log.INFO)) … … 182 219 183 220 // add summary bar link 184 Properties props = pluginProperties(ctx, appName);185 221 String name = ConfigClientsHelper.stripHTML(props, "consoleLinkName_" + Messages.getLanguage(ctx)); 186 222 if (name == null) -
apps/routerconsole/java/src/net/i2p/router/web/PluginUpdateHandler.java
r8fa7205 rbb7a88f 335 335 return; 336 336 } 337 oldVersion = LogsHelper.jettyVersion(); 338 minVersion = ConfigClientsHelper.stripHTML(props, "min-jetty-version"); 339 if (minVersion != null && 340 (new VersionComparator()).compare(minVersion, oldVersion) > 0) { 341 to.delete(); 342 statusDone("<b>" + _("Plugin requires Jetty version {0} or higher", minVersion) + "</b>"); 343 return; 344 } 345 maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version"); 346 if (maxVersion != null && 347 (new VersionComparator()).compare(maxVersion, oldVersion) < 0) { 348 to.delete(); 349 statusDone("<b>" + _("Plugin requires Jetty version {0} or lower", maxVersion) + "</b>"); 350 return; 351 } 337 352 338 353 // check if it is running first?
Note: See TracChangeset
for help on using the changeset viewer.