You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2010/12/12 19:04:25 UTC
svn commit: r1044867 -
/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java
Author: uschindler
Date: Sun Dec 12 18:04:25 2010
New Revision: 1044867
URL: http://svn.apache.org/viewvc?rev=1044867&view=rev
Log:
prepare Hudson's large line doc file
Modified:
lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java?rev=1044867&r1=1044866&r2=1044867&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LineFileDocs.java Sun Dec 12 18:04:25 2010
@@ -18,7 +18,7 @@ package org.apache.lucene.util;
*/
import java.io.Closeable;
-import java.io.FileNotFoundException;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -63,9 +63,10 @@ public class LineFileDocs implements Clo
private synchronized void open() throws IOException {
InputStream is = getClass().getResourceAsStream(path);
if (is == null) {
- throw new FileNotFoundException("cannot find line docs resource \"" + path + "\"");
+ // if its not in classpath, we load it as absolute filesystem path (e.g. Hudson's home dir)
+ is = new FileInputStream(path);
}
- if (path.toString().endsWith(".gz")) {
+ if (path.endsWith(".gz")) {
is = new GZIPInputStream(is);
}
final InputStream in = new BufferedInputStream(is, BUFFER_SIZE);