Author: sebb Date: Mon Aug 11 03:58:35 2008 New Revision: 684709 URL: http://svn.apache.org/viewvc?rev=684709&view=rev Log: Allow spaces in JMeter path names (apply work-round for Java bug 4496398)
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java jakarta/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java jakarta/jmeter/trunk/xdocs/changes.xml Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java?rev=684709&r1=684708&r2=684709&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java Mon Aug 11 03:58:35 2008 @@ -325,16 +325,6 @@ } else if (parser.getArgumentById(HELP_OPT) != null) { System.out.println(JMeterUtils.getResourceFileAsText("org/apache/jmeter/help.txt"));// $NON-NLS-1$ } else if (parser.getArgumentById(SERVER_OPT) != null) { - // We need to check if the JMeter home contains spaces in the path, - // because then we will not be able to bind to RMI registry, see - // Java bug id 4496398 - final String jmHome = JMeterUtils.getJMeterHome(); - if(jmHome.indexOf(" ") > -1) {// $NON-NLS-1$ - // Just warn user, and exit, no reason to continue, since we will - // not be able to bind to RMI registry, until Java bug 4496398 is fixed - log.error("JMeter path cannot contain spaces when run in server mode : " + jmHome); - throw new RuntimeException("JMeter path cannot contain spaces when run in server mode: "+jmHome); - } // Start the server startServer(JMeterUtils.getPropDefault("server_port", 0));// $NON-NLS-1$ startOptionalServers(); Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java?rev=684709&r1=684708&r2=684709&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java Mon Aug 11 03:58:35 2008 @@ -109,7 +109,7 @@ } } // usesUNC - jars.add(new URL("file", "", s));// $NON-NLS-1$ $NON-NLS-2$ + jars.add(new File(s).toURI().toURL());// See Java bug 4496398 classpath.append(CLASSPATH_SEPARATOR); classpath.append(s); } catch (MalformedURLException e) { @@ -137,7 +137,7 @@ public static void addURL(String path) { File furl = new File(path); try { - loader.addURL(furl.toURL()); + loader.addURL(furl.toURI().toURL()); // See Java bug 4496398 } catch (MalformedURLException e) { e.printStackTrace(); } @@ -160,14 +160,11 @@ */ public static void addPath(String path) throws MalformedURLException { File file = new File(path); - URL url; // Ensure that directory URLs end in "/" if (file.isDirectory() && !path.endsWith("/")) {// $NON-NLS-1$ - url = new URL("file","",path+ "/");// $NON-NLS-1$ - } else { - url = new URL("file","",path); + file = new File(path + "/");// $NON-NLS-1$ } - loader.addURL(url); + loader.addURL(file.toURI().toURL()); // See Java bug 4496398 StringBuffer sb = new StringBuffer(System.getProperty(JAVA_CLASS_PATH)); sb.append(CLASSPATH_SEPARATOR); sb.append(path); Modified: jakarta/jmeter/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=684709&r1=684708&r2=684709&view=diff ============================================================================== --- jakarta/jmeter/trunk/xdocs/changes.xml (original) +++ jakarta/jmeter/trunk/xdocs/changes.xml Mon Aug 11 03:58:35 2008 @@ -103,6 +103,7 @@ <li>Add Body (unescaped) source option to Regular Expression Extractor.</li> <li>Added __unescapeHtml() function: decodes Html-encoded text.</li> <li>Added __escapeHtml() function: encodes text using Html-encoding.</li> +<li>Allow spaces in JMeter path names (apply work-round for Java bug 4496398)</li> </ul> <h3>Non-functional changes</h3> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]