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("
File sessionFolder = new File(storeFolder, path);