<commit_before>package com.firefly.example.reactive.coffee.store.router.impl.sys;

import com.firefly.annotation.Component;
import com.firefly.annotation.Inject;
import com.firefly.codec.http2.model.HttpHeader;
import com.firefly.example.reactive.coffee.store.router.RouterInstaller;
import com.firefly.server.http2.HTTP2ServerBuilder;
import com.firefly.server.http2.router.handler.file.StaticFileHandler;
import com.firefly.utils.log.slf4j.ext.LazyLogger;

import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author <NAME>
 */
@Component("sysRouterInstaller")
public class SysRouterInstaller implements RouterInstaller {

    private static final LazyLogger logger = LazyLogger.create();

    @Inject
    private HTTP2ServerBuilder server;

    @Inject
    private GlobalHandler globalHandler;

    @Inject
    private TransactionalHandler transactionalHandler;

    @Override
    public void install() {
        // global handler
        server.router().path("*").handler(globalHandler);

        // HTTP transaction manager
        server.router().methods(transactionalHandler.getMethods()).handler(transactionalHandler);

        // static file
        try {
            Path path = Paths.get(SysRouterInstaller.class.getResource("/").toURI());
            StaticFileHandler staticFileHandler = new StaticFileHandler(path.toAbsolutePath().toString());
            server.router().get("/static/*").handler(ctx -> {
                ctx.put(HttpHeader.CACHE_CONTROL, "max-age=86400");
                staticFileHandler.handle(ctx);
            });
        } catch (URISyntaxException e) {
            logger.error(() -> "setup static file router exception", e);
        }
    }

    @Override
    public Integer order() {
        return 0;
    }
}<commit_msg>[test]: add local session<commit_after>package com.firefly.example.reactive.coffee.store.router.impl.sys;

import com.firefly.annotation.Component;
import com.firefly.annotation.Inject;
import com.firefly.codec.http2.model.HttpHeader;
import com.firefly.example.reactive.coffee.store.router.RouterInstaller;
import com.firefly.server.http2.HTTP2ServerBuilder;
import com.firefly.server.http2.router.handler.file.StaticFileHandler;
import com.firefly.server.http2.router.handler.session.HTTPSessionConfiguration;
import com.firefly.server.http2.router.handler.session.LocalHTTPSessionHandler;
import com.firefly.utils.log.slf4j.ext.LazyLogger;

import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author <NAME>
 */
@Component("sysRouterInstaller")
public class SysRouterInstaller implements RouterInstaller {

    private static final LazyLogger logger = LazyLogger.create();

    @Inject
    private HTTP2ServerBuilder server;

    @Inject
    private GlobalHandler globalHandler;

    @Inject
    private TransactionalHandler transactionalHandler;

    @Override
    public void install() {
        // global handler
        server.router().path("*").handler(globalHandler);

        // local session
        server.router().path("*").handler(new LocalHTTPSessionHandler(new HTTPSessionConfiguration()));

        // HTTP transaction manager
        server.router().methods(transactionalHandler.getMethods()).handler(transactionalHandler);

        // static file
        try {
            Path path = Paths.get(SysRouterInstaller.class.getResource("/").toURI());
            StaticFileHandler staticFileHandler = new StaticFileHandler(path.toAbsolutePath().toString());
            server.router().get("/static/*").handler(ctx -> {
                ctx.put(HttpHeader.CACHE_CONTROL, "max-age=86400");
                staticFileHandler.handle(ctx);
            });
        } catch (URISyntaxException e) {
            logger.error(() -> "setup static file router exception", e);
        }
    }

    @Override
    public Integer order() {
        return 0;
    }
}
{'fraction_non_alphanumeric': 0.11680693700586585, 'fraction_numerical': 0.0066309614894159655, 'mean_word_length': 3.3481152993348116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4633327', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1074, 'n_words': 190}