<commit_before>package org.netmelody.cii.response;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ResourceBundle;

import org.apache.commons.io.IOUtils;
import org.simpleframework.http.Path;
import org.simpleframework.http.Request;
import org.simpleframework.http.Response;
import org.simpleframework.http.resource.Resource;

public final class FileResponder implements Resource {

    private final String name;
    private final String extension;

    public FileResponder(Path path) {
        this.name = defaultString(path.getName(), "cieye.html");
        this.extension = defaultString(path.getExtension(), "html");
        System.out.println(path.getPath());
    }

    @Override
    public void handle(Request request, Response response) {
        InputStream input = null;
        OutputStream body = null;
        try {
            input = getClass().getResourceAsStream("/" + name);
            body = response.getOutputStream();
            long time = System.currentTimeMillis();
            response.set("Content-Type", contentTypeOf(extension));<commit_msg>default page is welcome.html now<commit_after>package org.netmelody.cii.response;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ResourceBundle;

import org.apache.commons.io.IOUtils;
import org.simpleframework.http.Path;
import org.simpleframework.http.Request;
import org.simpleframework.http.Response;
import org.simpleframework.http.resource.Resource;

public final class FileResponder implements Resource {

    private final String name;
    private final String extension;

    public FileResponder(Path path) {
        this.name = defaultString(path.getName(), (path.getSegments().length <= 1) ? "welcome.html" : "cieye.html");
        this.extension = defaultString(path.getExtension(), "html");
        System.out.println(path.getPath());
    }

    @Override
    public void handle(Request request, Response response) {
        InputStream input = null;
        OutputStream body = null;
        try {
            input = getClass().getResourceAsStream("/" + name);
            body = response.getOutputStream();
            long time = System.currentTimeMillis();
            response.set("Content-Type", contentTypeOf(extension));
{'fraction_non_alphanumeric': 0.10915341641598625, 'fraction_numerical': 0.0004297378599054577, 'mean_word_length': 3.5557729941291587, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '3011949', 'n_tokens_mistral': 619, 'n_tokens_neox': 609, 'n_words': 142}