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 2013/06/12 00:33:39 UTC
svn commit: r1491998 -
/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java
Author: uschindler
Date: Tue Jun 11 22:33:38 2013
New Revision: 1491998
URL: http://svn.apache.org/r1491998
Log:
Backport Javadocs changes from:
LUCENE-5047: Handle NoSuchFileException of Java 7 like FileNotFoundException when opeining index files; document this in Directory
Modified:
lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java?rev=1491998&r1=1491997&r2=1491998&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/Directory.java Tue Jun 11 22:33:38 2013
@@ -70,12 +70,12 @@ public abstract class Directory implemen
* Returns the length of a file in the directory. This method follows the
* following contract:
* <ul>
- * <li>Throws {@link FileNotFoundException} if the file does not exist
+ * <li>Must throw {@link FileNotFoundException} if the file does not exist
+ * (not {@code java.nio.file.NoSuchFileException} of Java 7).
* <li>Returns a value ≥0 if the file exists, which specifies its length.
* </ul>
*
* @param name the name of the file for which to return the length.
- * @throws FileNotFoundException if the file does not exist.
* @throws IOException if there was an IO error while retrieving the file's
* length.
*/
@@ -106,7 +106,9 @@ public abstract class Directory implemen
* the only Directory implementations that respect this
* parameter are {@link FSDirectory} and {@link
* CompoundFileDirectory}.
- */
+ * <li>Must throw {@link FileNotFoundException} if the file does not exist
+ * (not {@code java.nio.file.NoSuchFileException} of Java 7).
+ */
public abstract IndexInput openInput(String name, IOContext context) throws IOException;
/** Construct a {@link Lock}.
@@ -223,6 +225,8 @@ public abstract class Directory implemen
* efficiently open one or more sliced {@link IndexInput} instances from a
* single file handle. The underlying file handle is kept open until the
* {@link IndexInputSlicer} is closed.
+ * <li>Must throw {@link FileNotFoundException} if the file does not exist
+ * (not {@code java.nio.file.NoSuchFileException} of Java 7).
*
* @throws IOException
* if an {@link IOException} occurs