<commit_before>package fatjar.implementations.httpclient;

import fatjar.HttpClient;
import fatjar.Log;
import fatjar.implementations.server.dto.HttpMethod;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.BytesContentProvider;
import org.eclipse.jetty.client.util.PathContentProvider;
import org.eclipse.jetty.util.ssl.SslContextFactory;

import java.io.IOException;
import java.net.HttpCookie;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class JettyHttpClient implements HttpClient {

    private org.eclipse.jetty.client.HttpClient httpClient;
    private Request request;
    private ContentResponse contentResponse;

    public JettyHttpClient() {
        SslContextFactory sslContextFactory = new SslContextFactory();
        httpClient = new org.eclipse.jetty.client.HttpClient(sslContextFactory);
        httpClient.setFollowRedirects(false);
        try {
            httpClient.start();
        } catch (Exception e) {
            Log.error("got exception while starting http client, error: " + e, e);
        }
    }

    public static HttpClient create() {
        return new JettyHttpClient();
    }

    @Override
    public HttpClient url(String url) {
        request = httpClient.newRequest(url);
        return this;
    }

    @Override
    public HttpClient method(HttpMethod method) {
        request = request.method(org.eclipse.jetty.http.HttpMethod.valueOf(method.getValue()));
        return this;
    }

    @Override
    public HttpClient send() throws HttpClientException {
        try {
            contentResponse = request.send();
        } catch (InterruptedException | TimeoutException | ExecutionException e) {
            throw new HttpClientException(e);<commit_msg>removed unused create method from jetty http client<commit_after>package fatjar.implementations.httpclient;

import fatjar.HttpClient;
import fatjar.Log;
import fatjar.implementations.server.dto.HttpMethod;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.BytesContentProvider;
import org.eclipse.jetty.client.util.PathContentProvider;
import org.eclipse.jetty.util.ssl.SslContextFactory;

import java.io.IOException;
import java.net.HttpCookie;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class JettyHttpClient implements HttpClient {

    private org.eclipse.jetty.client.HttpClient httpClient;
    private Request request;
    private ContentResponse contentResponse;

    public JettyHttpClient() {
        SslContextFactory sslContextFactory = new SslContextFactory();
        httpClient = new org.eclipse.jetty.client.HttpClient(sslContextFactory);
        httpClient.setFollowRedirects(false);
        try {
            httpClient.start();
        } catch (Exception e) {
            Log.error("got exception while starting http client, error: " + e, e);
        }
    }

    @Override
    public HttpClient url(String url) {
        request = httpClient.newRequest(url);
        return this;
    }

    @Override
    public HttpClient method(HttpMethod method) {
        request = request.method(org.eclipse.jetty.http.HttpMethod.valueOf(method.getValue()));
        return this;
    }

    @Override
    public HttpClient send() throws HttpClientException {
        try {
            contentResponse = request.send();
        } catch (InterruptedException | TimeoutException | ExecutionException e) {
            throw new HttpClientException(e);
{'fraction_non_alphanumeric': 0.09240348692403487, 'fraction_numerical': 0.0, 'mean_word_length': 3.594965675057208, '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': '4824559', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1096, 'n_words': 239}