<commit_before>package com.aquaticinformatics.aquarius.sdk.helpers;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
import java.util.stream.Stream;

public class MultipartBuilder {

    public String boundaryMarker;

    private static final String LineFeed = "\r\n";

    private ByteArrayOutputStream outputStream;

    public MultipartBuilder() {
        boundaryMarker = "****" + UUID.randomUUID().toString() + "****";

        outputStream = new ByteArrayOutputStream();
    }

    public void addField(String fieldName, String value) {
        writeFieldBoundary();
        writeLine("Content-Disposition: form-data; name=\"" + fieldName + "\"");
        writeLine("Content-Type: text/plain; charset=UTF-8");
        writeLine("");
        writeLine(value);
    }

    public void addFileContent(String fieldName, String fileName, InputStream content) {
        writeFieldBoundary();
        writeLine("Content-Disposition: form-data; name=\"" + fieldName + "\"; filename=\"" + fileName + "\"");
        writeLine("Content-Type: text/plain; charset=UTF-8");
        writeLine("");
<commit_msg>PF-52 Set the file content type correctly<commit_after>package com.aquaticinformatics.aquarius.sdk.helpers;

import java.io.*;
import java.nio.file.Path;
import java.util.UUID;
import java.util.stream.Stream;

public class MultipartBuilder {

    public String boundaryMarker;

    private static final String LineFeed = "\r\n";

    private ByteArrayOutputStream outputStream;

    public MultipartBuilder() {
        boundaryMarker = "****" + UUID.randomUUID().toString() + "****";

        outputStream = new ByteArrayOutputStream();
    }

    public void addField(String fieldName, String value) {
        writeFieldBoundary();
        writeLine("Content-Disposition: form-data; name=\"" + fieldName + "\"");
        writeLine("Content-Type: text/plain; charset=UTF-8");
        writeLine("");
        writeLine(value);
    }

    public void addFileContent(String fieldName, String fileName, InputStream content) {
        writeFieldBoundary();
        writeLine("Content-Disposition: form-data; name=\"" + fieldName + "\"; filename=\"" + fileName + "\"");
        writeLine("Content-Type: application/octet-stream");
        writeLine("");

{'fraction_non_alphanumeric': 0.13595933926302414, 'fraction_numerical': 0.0021177467174925877, 'mean_word_length': 3.55984555984556, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2500558', 'n_tokens_mistral': 651, 'n_tokens_neox': 643, 'n_words': 143}