Author: tv
Date: Wed Apr  2 10:36:05 2014
New Revision: 1583957

URL: http://svn.apache.org/r1583957
Log:
Fix property setter

Modified:
    
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
    
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/PropertySetter.java

Modified: 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java?rev=1583957&r1=1583956&r2=1583957&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
 (original)
+++ 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
 Wed Apr  2 10:36:05 2014
@@ -59,18 +59,28 @@ public abstract class AbstractDiskCacheA
     protected int shutdownSpoolTimeLimit = DEFAULT_shutdownSpoolTimeLimit;
 
     /**
-     * Sets the diskPath attribute of the IJISPCacheAttributes object
+     * Sets the diskPath attribute of the DiskCacheAttributes object
      * <p>
      * @param path The new diskPath value
      */
     public void setDiskPath( String path )
     {
-        this.diskPath = new File( path );
+        setDiskPath( new File( path ) );
+    }
+
+    /**
+     * Sets the diskPath attribute of the DiskCacheAttributes object
+     * <p>
+     * @param diskPath The new diskPath value
+     */
+    public void setDiskPath( File diskPath )
+    {
+        this.diskPath = diskPath;
         boolean result = this.diskPath.mkdirs();
 
         if (!result)
         {
-            log.error("Failed to create directory " + path);
+            log.error("Failed to create directory " + diskPath);
         }
     }
 

Modified: 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/PropertySetter.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/PropertySetter.java?rev=1583957&r1=1583956&r2=1583957&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/PropertySetter.java
 (original)
+++ 
commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/config/PropertySetter.java
 Wed Apr  2 10:36:05 2014
@@ -23,6 +23,7 @@ import java.beans.BeanInfo;
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
+import java.io.File;
 import java.lang.reflect.Method;
 import java.util.Enumeration;
 import java.util.Properties;
@@ -262,6 +263,10 @@ public class PropertySetter
                 return Boolean.FALSE;
             }
         }
+        else if ( File.class.isAssignableFrom( type ) )
+        {
+            return new File( v );
+        }
         return null;
     }
 


Reply via email to