commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <>
Subject [jira] [Commented] (JCS-163) false error message when reusing a cache directory
Date Fri, 03 Jun 2016 09:05:59 GMT


Gary Gregory commented on JCS-163:

Patches (with unit tests) welcome! ;-)

> false error message when reusing a cache directory
> --------------------------------------------------
>                 Key: JCS-163
>                 URL:
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Indexed Disk Cache, JDBC Disk Cache
>    Affects Versions: jcs-2.0-beta-1
>            Reporter: Mark Fulton
> 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)}}|]
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.

This message was sent by Atlassian JIRA

View raw message