Apache Lucene 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.javaindex 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 TestCaseprotected 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;}