You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Vandahl (JIRA)" <ji...@apache.org> on 2016/08/07 09:55:20 UTC

[jira] [Resolved] (JCS-163) false error message when reusing a cache directory

     [ https://issues.apache.org/jira/browse/JCS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Vandahl resolved JCS-163.
--------------------------------
       Resolution: Not A Bug
    Fix Version/s: jcs-2.0-beta-2

> false error message when reusing a cache directory
> --------------------------------------------------
>
>                 Key: JCS-163
>                 URL: https://issues.apache.org/jira/browse/JCS-163
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Indexed Disk Cache, JDBC Disk Cache
>    Affects Versions: jcs-2.0-beta-1
>            Reporter: Mark Fulton
>             Fix For: jcs-2.0-beta-2
>
>
> JCS logs an {{ERROR}} if the disk cache directory already existed:
> {noformat}
> 63   [main] ERROR org.apache.commons.jcs.auxiliary.disk.AbstractDiskCacheAttributes  - Failed to create directory C:\MyCache
> {noformat}
> This is because [{{AbstractDiskCacheAttributes.setDiskPath(File)}}|http://commons.apache.org/proper/commons-jcs/commons-jcs-core/apidocs/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.html#setDiskPath(java.io.File)] [uses|http://commons.apache.org/proper/commons-jcs/commons-jcs-core/xref/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.html#L80] the result of [{{File.mkdirs()}}|http://docs.oracle.com/javase/6/docs/api/java/io/File.html#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()}}|http://docs.oracle.com/javase/6/docs/api/java/io/File.html#exists()] (or similar) should be used instead to trigger logging an {{ERROR}} or not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)