Author: tv
Date: Wed Apr  1 15:24:50 2015
New Revision: 1670674

URL: http://svn.apache.org/r1670674
Log:
Fix JCS-145: AbstractDiskCacheAttributes logs error, when directory already 
exists

Modified:
    
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java

Modified: 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java?rev=1670674&r1=1670673&r2=1670674&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
 Wed Apr  1 15:24:50 2015
@@ -77,8 +77,12 @@ public abstract class AbstractDiskCacheA
     public void setDiskPath( File diskPath )
     {
         this.diskPath = diskPath;
-        boolean result = this.diskPath.mkdirs();
-
+        boolean result = this.diskPath.isDirectory(); 
+        
+        if (!result)
+        {
+                       result = this.diskPath.mkdirs();
+        }
         if (!result)
         {
             log.error("Failed to create directory " + diskPath);


Reply via email to