commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1748169 - /commons/proper/net/trunk/src/test/java/examples/MainTest.java
Date Mon, 13 Jun 2016 10:09:25 GMT
Author: sebb
Date: Mon Jun 13 10:09:24 2016
New Revision: 1748169

URL: http://svn.apache.org/viewvc?rev=1748169&view=rev
Log:
Jenkins uses special characters in path names which get encoded in URLs

Modified:
    commons/proper/net/trunk/src/test/java/examples/MainTest.java

Modified: commons/proper/net/trunk/src/test/java/examples/MainTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/examples/MainTest.java?rev=1748169&r1=1748168&r2=1748169&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/examples/MainTest.java (original)
+++ commons/proper/net/trunk/src/test/java/examples/MainTest.java Mon Jun 13 10:09:24 2016
@@ -21,6 +21,7 @@ import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URLDecoder;
 import java.security.CodeSource;
 import java.util.Enumeration;
 import java.util.Properties;
@@ -52,7 +53,7 @@ public class MainTest {
 
     private Properties scanClasses() throws IOException {
         CodeSource codeSource = Main.class.getProtectionDomain().getCodeSource();
-        final String sourceFile = codeSource.getLocation().getFile();
+        final String sourceFile = URLDecoder.decode(codeSource.getLocation().getFile(),"UTF-8");
// ensure special characters are decoded OK
         Properties p = new Properties();
         if (sourceFile.endsWith(".jar")) {
             JarFile jf = new JarFile(sourceFile);



Mime
View raw message