commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject svn commit: r368816 - /jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java
Date Fri, 13 Jan 2006 18:30:39 GMT
Author: ozeigermann
Date: Fri Jan 13 10:30:34 2006
New Revision: 368816

URL: http://svn.apache.org/viewcvs?rev=368816&view=rev
Log:
Fixed error reporting when resources could not be created

Modified:
    jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java

Modified: jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java?rev=368816&r1=368815&r2=368816&view=diff
==============================================================================
--- jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java
(original)
+++ jakarta/commons/proper/transaction/trunk/src/java/org/apache/commons/transaction/util/FileHelper.java
Fri Jan 13 10:30:34 2006
@@ -132,7 +132,7 @@
                         }
                     } else {
                         if (!targetFile.exists()) {
-                            if (targetFile.mkdirs()) {
+                            if (!targetFile.mkdirs()) {
                                 throw new IOException("Could not create target directory:
"
                                         + targetFile);
                             }
@@ -187,8 +187,10 @@
         } else {
             if (!target.isDirectory()) {
                 if (!target.exists()) {
-                    target.getParentFile().mkdirs();
-                    if (target.createNewFile()) {
+                    if(!target.getParentFile().mkdirs()) {
+                        throw new IOException("Could not create target directory: " + target.getParentFile());
+                    }
+                    if (!target.createNewFile()) {
                         throw new IOException("Could not create target file: " + target);
                     }
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message