Apache Solr open-source search software
throw a more helpful exception if supposed directory is a file
Daniel Naber129227dce17c
diff --git a/src/java/org/apache/lucene/store/FSDirectory.java b/src/java/org/apache/lucene/store/FSDirectory.javaindex 6185f6c34be..b8535c35c36 100644--- a/src/java/org/apache/lucene/store/FSDirectory.java+++ b/src/java/org/apache/lucene/store/FSDirectory.java@@ -181,6 +181,9 @@ public class FSDirectory extends Directory {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 filesfor (int i = 0; i < files.length; i++) {File file = new File(directory, files[i]);