Author: sebb
Date: Fri Mar 5 01:40:50 2010
New Revision: 919265
URL: http://svn.apache.org/viewvc?rev=919265&view=rev
Log:
IO-205 FileUtils.forceMkdir Javadoc is unclear
Modified:
commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
URL:
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?rev=919265&r1=919264&r2=919265&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
(original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Fri
Mar 5 01:40:50 2010
@@ -1520,16 +1520,18 @@
/**
* Makes a directory, including any necessary but nonexistent parent
- * directories. If there already exists a file with specified name or
- * the directory cannot be created then an exception is thrown.
+ * directories. If a file already exists with specified name but it is
+ * not a directory then an IOException is thrown.
+ * If the directory cannot be created (or does not already exist)
+ * then an IOException is thrown.
*
* @param directory directory to create, must not be <code>null</code>
* @throws NullPointerException if the directory is <code>null</code>
- * @throws IOException if the directory cannot be created
+ * @throws IOException if the directory cannot be created or the file
already exists but is not a directory
*/
public static void forceMkdir(File directory) throws IOException {
if (directory.exists()) {
- if (directory.isFile()) {
+ if (!directory.isDirectory()) {
String message =
"File "
+ directory