<commit_before>package com.github.agjacome.httpserver.controller;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;

import com.github.agjacome.httpserver.model.Session;
import com.github.agjacome.httpserver.model.repository.SessionRepository;
import com.github.agjacome.httpserver.server.ServerRequest;
import com.github.agjacome.httpserver.server.http.HttpResponse;
import com.github.agjacome.httpserver.server.http.HttpResponseBuilder;
import com.github.agjacome.httpserver.view.View;

import static java.util.Objects.requireNonNull;

import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.FORBIDDEN;
import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.FOUND;
import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.OK;

public final class PageController extends SessionController {

    private final View view;

    public static Controller pageController(
        final View view, final SessionRepository sessions
    ) {
        return new PageController(view, sessions);
    }

    public PageController(final View view, final SessionRepository sessions) {
        super(sessions);
        this.view = requireNonNull(view);
    }

    @Override
    protected void handleRequest(final ServerRequest request) throws Exception {
        final Optional<Session> session = getSession(request.getHttpRequest());
<commit_msg>Update session last action time on page access<commit_after>package com.github.agjacome.httpserver.controller;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;

import com.github.agjacome.httpserver.model.Session;
import com.github.agjacome.httpserver.model.repository.SessionRepository;
import com.github.agjacome.httpserver.server.ServerRequest;
import com.github.agjacome.httpserver.server.http.HttpResponse;
import com.github.agjacome.httpserver.server.http.HttpResponseBuilder;
import com.github.agjacome.httpserver.view.View;

import static java.util.Objects.requireNonNull;

import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.FORBIDDEN;
import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.FOUND;
import static com.github.agjacome.httpserver.server.http.HttpStatusCode.StandardHttpStatusCode.OK;

public final class PageController extends SessionController {

    private final View view;

    public static Controller pageController(
        final View view, final SessionRepository sessions
    ) {
        return new PageController(view, sessions);
    }

    public PageController(final View view, final SessionRepository sessions) {
        super(sessions);
        this.view = requireNonNull(view);
    }

    @Override
    protected void handleRequest(final ServerRequest request) throws Exception {
        final Optional<Session> session = getSession(request.getHttpRequest())
                                         .flatMap(this::updateSession);

{'fraction_non_alphanumeric': 0.08349086326402017, 'fraction_numerical': 0.0, 'mean_word_length': 4.804387568555759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2017898', 'n_tokens_mistral': 858, 'n_tokens_neox': 843, 'n_words': 172}