<commit_before>package com.jfrog.xray.client.impl;

import com.jfrog.xray.client.Xray;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;

import java.net.MalformedURLException;
import java.net.URISyntaxException;

/**
 * Created by romang on 2/2/17.
 */
public class XrayClient {

    static public Xray create(CloseableHttpClient preConfiguredClient, String url) {
        return new XrayImpl(preConfiguredClient, url);
    }

    /**
     * Username, API key, and custom url
     */
    static public Xray create(String url, String username, String password) {
        XrayClientConfigurator configurator = new XrayClientConfigurator();
        configurator.setHostFromUrl(url);
        configurator.setCredentials(username, password, true);

        return new XrayImpl(configurator.getClient(), url);
    }
}
<commit_msg>Added timeout for Xray requests<commit_after>package com.jfrog.xray.client.impl;

import com.jfrog.xray.client.Xray;
import org.apache.http.impl.client.CloseableHttpClient;

/**
 * Created by romang on 2/2/17.
 */
public class XrayClient {

    private static int CONNECTION_TIMOUT = 300;

    static public Xray create(CloseableHttpClient preConfiguredClient, String url) {
        return new XrayImpl(preConfiguredClient, url);
    }

    /**
     * Username, API key, and custom url
     */
    static public Xray create(String url, String username, String password) {
        XrayClientConfigurator configurator = new XrayClientConfigurator();
        configurator.setHostFromUrl(url);
        configurator.setCredentials(username, password, true);
        configurator.setConnectTimeout(CONNECTION_TIMOUT);
        configurator.setSocketTimeout(CONNECTION_TIMOUT);

        return new XrayImpl(configurator.getClient(), url);
    }
}

{'fraction_non_alphanumeric': 0.09605799728137744, 'fraction_numerical': 0.004984141368373357, 'mean_word_length': 4.111111111111111, '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': '3872654', 'n_tokens_mistral': 674, 'n_tokens_neox': 660, 'n_words': 137}