lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r169136 - /lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
Date Sun, 08 May 2005 14:51:30 GMT
Author: dnaber
Date: Sun May  8 07:51:29 2005
New Revision: 169136

URL: http://svn.apache.org/viewcvs?rev=169136&view=rev
Log:
throw a more helpful exception if supposed directory is a file

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java?rev=169136&r1=169135&r2=169136&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java Sun May  8 07:51:29
2005
@@ -181,6 +181,9 @@
       if (!directory.mkdirs())
         throw new IOException("Cannot create directory: " + directory);
 
+    if (!directory.isDirectory())
+      throw new IOException(directory + " not a directory");
+
     String[] files = directory.list(new LuceneFileFilter());            // clear old files
     for (int i = 0; i < files.length; i++) {
       File file = new File(directory, files[i]);



Mime
View raw message