<commit_before>/*******************************************************************************
 * Copyright 2012 Technology Blueprint Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package uk.co.techblue.docusign.client;

import java.io.IOException;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.ws.rs.ext.Provider;

import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.client.ProxyFactory;
import org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor;
import org.jboss.resteasy.logging.Logger;
import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.spi.ResteasyProviderFactory;

import uk.co.techblue.docusign.client.credential.DocuSignCredentials;
import uk.co.techblue.docusign.client.utils.DocuSignUtils;
import uk.co.techblue.docusign.resteasy.providers.DocumentFileProvider;

public class DocuSignClient {
	public static void main(String[] args) throws ClientProtocolException,
			IOException {
		ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
		int maxPerRoute = 50;
		cm.setDefaultMaxPerRoute(maxPerRoute);
		cm.setMaxTotal(maxPerRoute);

		HttpClient client = new DefaultHttpClient(cm);
		HttpParams params = client.getParams();
		// Allowable time between packets
		HttpConnectionParams.setSoTimeout(params, 6000);
		// Allowable time to get a connection
		HttpConnectionParams.setConnectionTimeout(params, 6000);
<commit_msg>Added comments<commit_after>/*******************************************************************************
 * Copyright 2012 Technology Blueprint Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package uk.co.techblue.docusign.client;

import java.io.IOException;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.ws.rs.ext.Provider;

import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.client.ProxyFactory;
import org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor;
import org.jboss.resteasy.logging.Logger;
import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.spi.ResteasyProviderFactory;

import uk.co.techblue.docusign.client.credential.DocuSignCredentials;
import uk.co.techblue.docusign.client.utils.DocuSignUtils;
import uk.co.techblue.docusign.resteasy.providers.DocumentFileProvider;
/**
 * The HTTP client can be configured adding in the classpath the following properties file:
 * uk.co.techblue.docusign.client.DocuSignClient.properties
 * The configuration allows to set the timeout and the maximum number of connections per route:
 *     docusign.connection.timeout=20000
 *     docusign.max.per.route=50
 * It can also configure a proxy:
 *    docusign.https.proxyHost=<IP address or hostname of the proxy>
 *    docusign.https.proxyPort=listening port of the proxy
 */
public class DocuSignClient {
	public static void main(String[] args) throws ClientProtocolException,
			IOException {
		ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
		int maxPerRoute = 50;
		cm.setDefaultMaxPerRoute(maxPerRoute);
		cm.setMaxTotal(maxPerRoute);

		HttpClient client = new DefaultHttpClient(cm);
		HttpParams params = client.getParams();
		// Allowable time between packets
		HttpConnectionParams.setSoTimeout(params, 6000);
		// Allowable time to get a connection
		HttpConnectionParams.setConnectionTimeout(params, 6000);

{'fraction_non_alphanumeric': 0.1378183069511356, 'fraction_numerical': 0.007742601514108741, 'mean_word_length': 5.673938002296211, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4559941', 'n_tokens_mistral': 1682, 'n_tokens_neox': 1577, 'n_words': 409}