You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by dn...@apache.org on 2005/05/08 16:51:30 UTC
svn commit: r169136 -
/lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
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]);