[freenet-cvs] r19274 - trunk/freenet/src/freenet/pluginmanager

dbkr at freenetproject.org dbkr at freenetproject.org
Sun Apr 13 23:40:33 UTC 2008


Author: dbkr
Date: 2008-04-13 23:40:33 +0000 (Sun, 13 Apr 2008)
New Revision: 19274

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
Work around the insane download server and name our plugins sensibly. This should save some confusion.


Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java	2008-04-13 21:51:43 UTC (rev 19273)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java	2008-04-13 23:40:33 UTC (rev 19274)
@@ -263,7 +263,7 @@
 		File pluginDirectory = new File(node.getNodeDir(), "plugins");
 		if (lastSlash == -1) {
 			/* it's an official plugin! */
-			pluginFile = new File(pluginDirectory, pluginSpecification + ".jar.url");
+			pluginFile = new File(pluginDirectory, pluginSpecification + ".jar");
 		} else {
 			pluginFile = new File(pluginDirectory, pluginSpecification.substring(lastSlash + 1));
 		}
@@ -491,6 +491,11 @@
 		/* get plugin filename. */
 		String completeFilename = pluginUrl.getPath();
 		String filename = completeFilename.substring(completeFilename.lastIndexOf('/') + 1);
+		// The URL to the JAR file might end with .url because of the insane download server that redirects to a JAR file
+		// in response to a request for a file ending '.url'. Strip it off if so, since we want our JAR to end with '.jar'.
+		if (filename.endsWith(".url")) {
+			filename = filename.substring(0, filename.length() - 4);
+		}
 		pluginFile = new File(pluginDirectory, filename);
 
 		/* check if file needs to be downloaded. */




More information about the cvs mailing list