<commit_before>package com.github.dreamhead.moco.dumper;

import com.github.dreamhead.moco.HttpMessage;
import com.google.common.net.HttpHeaders;
import io.netty.util.internal.StringUtil;

public class HttpDumpers {
    public static String asContent(HttpMessage message) {
        StringBuilder buf = new StringBuilder();
        long length = getContentLength(message, -1);
        if (length > 0) {
            buf.append(StringUtil.NEWLINE);
            buf.append(StringUtil.NEWLINE);
            String type = message.getHeaders().get(HttpHeaders.CONTENT_TYPE);
            if (isText(type)) {
                buf.append(message.getContent().toString());
            } else {
                buf.append("<content is binary>");
            }
        }
        return buf.toString();
    }<commit_msg>simplified content dump<commit_after>package com.github.dreamhead.moco.dumper;

import com.github.dreamhead.moco.HttpMessage;
import com.google.common.net.HttpHeaders;
import io.netty.util.internal.StringUtil;

public class HttpDumpers {
    public static String asContent(HttpMessage message) {
        long length = getContentLength(message, -1);
        if (length > 0) {
            return StringUtil.NEWLINE + StringUtil.NEWLINE + contentForDump(message);
        }

        return "";
    }

    private static String contentForDump(HttpMessage message) {
        String type = message.getHeaders().get(HttpHeaders.CONTENT_TYPE);
        if (isText(type)) {
            return message.getContent().toString();
        }

        return "<content is binary>";
    }
{'fraction_non_alphanumeric': 0.10920634920634921, 'fraction_numerical': 0.0025396825396825397, 'mean_word_length': 2.6651162790697676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3142373', 'n_tokens_mistral': 444, 'n_tokens_neox': 431, 'n_words': 87}