Wicket
  1. Wicket
  2. WICKET-1758

Make DiskPageStore#getSessionFolder protected (rather than private)

    Details

    • Type: Wish Wish
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5, 1.4-RC1
    • Component/s: wicket
    • Labels:
      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);

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Nick Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development