Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1758

Make DiskPageStore#getSessionFolder protected (rather than private)

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.4
    • 1.3.5, 1.4-RC1
    • wicket
    • None

    Description

      So that people (like me!) can extend DiskPageStore and implement our directory / file hierarchy of choice, it would be nice if getSessionFolder were protected rather than private. To make sure people don't make silly mistakes it might be necessary to break this up into two methods (since this method determines the pathname AND creates it if it doesn't exist) and make the filename determination part the protected one.

      My use case is that I'd like to be able to introduce a directory hierarchy for reasons of performance and filesystem limitations so every pagestore directory isn't rooted off the same single directory. I'd probably add some code like this:

      long hashCode = sessionId.hashCode() & 0xffffff00;
      String hexHashCode = String.format("%08x", hashCode);
      String path = hexHashCode.substring(0, 3) + File.pathSeparator
      + hexHashCode.substring(3, 6) + File.pathSeparator + sessionId.replaceAll("
      W", "_");

      File sessionFolder = new File(storeFolder, path);

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            spatula Nick Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: