From bc72163b4c5d7aa9cbd69dcd24cc301367b6df6f Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sun, 12 Dec 2010 18:04:25 +0000 Subject: [PATCH] prepare Hudson's large line doc file git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1044867 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/test/org/apache/lucene/util/LineFileDocs.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lucene/src/test/org/apache/lucene/util/LineFileDocs.java b/lucene/src/test/org/apache/lucene/util/LineFileDocs.java index ebbafb1e6ed..fe3c0eb355a 100644 --- a/lucene/src/test/org/apache/lucene/util/LineFileDocs.java +++ b/lucene/src/test/org/apache/lucene/util/LineFileDocs.java @@ -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 Closeable { 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);