Deal with spaces in file references

Fixes gh-1169
This commit is contained in:
Phillip Webb
2014-06-25 15:43:07 -07:00
parent 7654259f80
commit 7e7733d45d
4 changed files with 8 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@@ -106,7 +107,8 @@ public class ExplodedArchiveTests {
@Test
public void getUrl() throws Exception {
URL url = this.archive.getUrl();
assertThat(new File(url.toURI()), equalTo(new File(this.rootFolder.toURI())));
assertThat(new File(URLDecoder.decode(url.getFile(), "UTF-8")),
equalTo(this.rootFolder));
}
@Test

View File

@@ -97,7 +97,6 @@ public class JarFileTests {
assertThat(urlClassLoader.getResource("special/\u00EB.dat"), notNullValue());
assertThat(urlClassLoader.getResource("d/9.dat"), notNullValue());
jarFile.close();
}
@Test