<commit_before>package com.jamierf.jutorrent;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.http.util.EntityUtils;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UTorrent {

	private static final Logger logger = LoggerFactory.getLogger(UTorrent.class);

	private final String baseURL;
	private final String token;

	private final HttpClient client;

	private final TorrentList torrents;

	public UTorrent(InetSocketAddress address, String username, String password, int delay) {
		client = new DefaultHttpClient();

		// Use HTTP 1.1
		client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);

		// Authentication
		((DefaultHttpClient) client).getCredentialsProvider().setCredentials(new AuthScope(address.getHostString(), address.getPort(), AuthScope.ANY_REALM), new UsernamePasswordCredentials(username, password));

		baseURL = "http://" + address.getHostString() + ":" + address.getPort() + "/gui/";
		token = this.getToken();

		torrents = new TorrentList(this, Executors.newCachedThreadPool());
		torrents.update();

		Executors.newSingleThreadScheduledExecutor().scheduleWithFixedDelay(new Runnable() {
			public void run() {<commit_msg>Removing Java 7 method call<commit_after>package com.jamierf.jutorrent;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.http.util.EntityUtils;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UTorrent {

	private static final Logger logger = LoggerFactory.getLogger(UTorrent.class);

	private final String baseURL;
	private final String token;

	private final HttpClient client;

	private final TorrentList torrents;

	public UTorrent(InetSocketAddress address, String username, String password, int delay) {
		client = new DefaultHttpClient();

		// Use HTTP 1.1
		client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);

		// Authentication
		((DefaultHttpClient) client).getCredentialsProvider().setCredentials(new AuthScope(address.getAddress().getHostAddress(), address.getPort(), AuthScope.ANY_REALM), new UsernamePasswordCredentials(username, password));

		baseURL = "http://" + address.getAddress().getHostAddress() + ":" + address.getPort() + "/gui/";
		token = this.getToken();

		torrents = new TorrentList(this, Executors.newCachedThreadPool());
		torrents.update();

		Executors.newSingleThreadScheduledExecutor().scheduleWithFixedDelay(new Runnable() {
			public void run() {
{'fraction_non_alphanumeric': 0.11182401466544455, 'fraction_numerical': 0.0029789184234647113, 'mean_word_length': 6.097560975609756, 'pattern_counts': {'":': 2, '<': 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': '5707073', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1295, 'n_words': 252}