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:05:31 UTC

svn commit: r1044868 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/src/test/org/apache/lucene/util/LineFileDocs.java solr/

Author: uschindler
Date: Sun Dec 12 18:05:31 2010
New Revision: 1044868

URL: http://svn.apache.org/viewvc?rev=1044868&view=rev
Log:
prepare Hudson's large line doc file

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/LineFileDocs.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/LineFileDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/LineFileDocs.java?rev=1044868&r1=1044867&r2=1044868&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/LineFileDocs.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/util/LineFileDocs.java Sun Dec 12 18:05:31 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);