Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-163

false error message when reusing a cache directory

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mfulton26 Mark Fulton
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment