Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Bug
-
jcs-2.0-beta-1
-
None
Description
JCS logs an ERROR if the disk cache directory already existed:
63 [main] ERROR org.apache.commons.jcs.auxiliary.disk.AbstractDiskCacheAttributes - Failed to create directory C:\MyCache
This is because AbstractDiskCacheAttributes.setDiskPath(File) uses the result of File.mkdirs() as if it returns true if the directories exist after invocation but this is not the case, it only returns "true if and only if the directory was created, along with all necessary parent directories; false otherwise."
File.exists() (or similar) should be used instead to trigger logging an ERROR or not.