class FileSessionStorage implements SessionStorage {

    @Override
    public void persistSession(final HttpSessionImpl session) throws IOException {
        if (!isSessionIdValid(session.getId())) {
            throw new IllegalArgumentException("Session ID can not be empty and must be composed of 32 characters");
        }

        File file = new File(getSessionStoragePath(session.getId()));
        if (!file.exists() && !file.createNewFile()) {
            throw new IOException("Unable to create new file " + file.getAbsolutePath());
        }
        writeSession(session, file);

        LOGGER.log(Level.FINE, "Persisted session {0} in {1}",
                new Object[]{session.getId(), tempPath});
    }

    public  FileSessionStorage(final String tempPath);

}