Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1416: don't fail contrib/ant's unit test when file path contains non-URL safe characters like space

Michael McCandlessda78e20bd06c
diff --git a/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java b/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java
index e9c21e4477e..d7c5798d287 100644
--- a/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java
+++ b/contrib/ant/src/test/org/apache/lucene/ant/DocumentTestCase.java
@@ -19,6 +19,7 @@ package org.apache.lucene.ant;
import java.io.File;
import java.io.IOException;
+import java.net.URLDecoder;
import junit.framework.TestCase;
@@ -31,8 +32,8 @@ public abstract class DocumentTestCase extends TestCase
protected File getFile(String filename) throws IOException {
String fullname =
this.getClass().getResource(filename).getFile();
-
- File file = new File(fullname);
+
+ File file = new File(URLDecoder.decode(fullname, "UTF-8"));
return file;
}