roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r452239 - /incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java
Date Mon, 02 Oct 2006 21:56:42 GMT
Author: agilliland
Date: Mon Oct  2 14:56:41 2006
New Revision: 452239

URL: http://svn.apache.org/viewvc?view=rev&rev=452239
Log:
don't fail if trying to create a directory that already exists.


Modified:
    incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java?view=diff&rev=452239&r1=452238&r2=452239
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/business/FileManagerImpl.java Mon Oct  2
14:56:41 2006
@@ -161,6 +161,12 @@
         // now construct path to new directory
         File dir = new File(uploadDir.getAbsolutePath() + File.separator + path);
         
+        // check if it already exists
+        if(dir.exists() && dir.isDirectory() && dir.canRead()) {
+            // already exists, we don't need to do anything
+            return;
+        }
+        
         // create it
         if(!dir.mkdir()) {
             // failed for some reason



Mime
View raw message