<commit_before>package debugging;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
import java.util.Scanner;

import us.kbase.abstracthandle.AbstractHandleClient;


public class HandleServiceTest {
	private static final String EXPC_ERR = 
			"{\"version\":\"1.1\",\"error\":{\"name\":\"JSONRPCError\",\"code\":-32300,\"message\":\"HTTP GET not allowed.\"},\"id\":";
	private static final String URL = "http://dev03.berkeley.kbase.us:7109";

	public static void main(String [] args) throws Exception{
		System.out.println(URL);
		int count = Integer.parseInt(args[2]);
		for (int i = 0; i < count; i++) {
			System.out.print(i + "\n");
			HttpURLConnection httpConn = (HttpURLConnection)
					new URL(URL).openConnection();
			httpConn.getResponseCode();
			InputStream is = httpConn.getErrorStream();
			Scanner s = new Scanner(is);
			s.useDelimiter("\\A");
			String err = s.next();
			if (!err.startsWith(EXPC_ERR)) {
				System.out.println(err);
			}
			s.close();
			try {
				final AbstractHandleClient hmc;
				hmc = new AbstractHandleClient(new URL(URL), args[0], args[1]);
				hmc.setIsInsecureHttpConnectionAllowed(true);
				hmc.setAllSSLCertificatesTrusted(true);
				hmc.areReadable(Arrays.asList("KBH_3"));
			} catch (Exception e) {
				System.out.println(e.getClass().getName() + ": " +
						e.getLocalizedMessage());
			}
			Thread.sleep(1000);
		}
	}
}<commit_msg>KBASE-1016 #comment Pulled the core guts out of the client, they work<commit_after>package debugging;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
import java.util.Scanner;

import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;

import us.kbase.abstracthandle.AbstractHandleClient;
import us.kbase.auth.AuthService;
import us.kbase.auth.AuthToken;


public class HandleServiceTest {
	private static final String EXPC_ERR = 
			"{\"version\":\"1.1\",\"error\":{\"name\":\"JSONRPCError\",\"code\":-32300,\"message\":\"HTTP GET not allowed.\"},\"id\":";
	private static final String URL = "http://dev03.berkeley.kbase.us:7109";
	private static final boolean PRIOR_GET = false;
	private static final boolean CLIENT = false;
	

	public static void main(String [] args) throws Exception{
		System.out.println(URL);
		int count = Integer.parseInt(args[2]);
		for (int i = 0; i < count; i++) {
			System.out.print(i + "\n");
			if (PRIOR_GET) {
				HttpURLConnection httpConn = (HttpURLConnection)
						new URL(URL).openConnection();
				httpConn.getResponseCode();
				InputStream is = httpConn.getErrorStream();
				Scanner s = new Scanner(is);
				s.useDelimiter("\\A");
				String err = s.next();
				if (!err.startsWith(EXPC_ERR)) {
					System.out.println(err);
				}
				s.close();
			}
			try {
				if (CLIENT) {
					final AbstractHandleClient hmc;
					hmc = new AbstractHandleClient(new URL(URL),
							args[0], args[1]);
					hmc.setIsInsecureHttpConnectionAllowed(true);
					hmc.setAllSSLCertificatesTrusted(true);
					hmc.areReadable(Arrays.asList("KBH_3"));
				} else {
					HttpURLConnection conn =
							(HttpURLConnection) new URL(URL).openConnection();
					conn.setDoOutput(true);
					conn.setRequestMethod("POST");
					AuthToken accessToken = AuthService.login(
							args[0], args[1]).getToken();
					conn.setRequestProperty("Authorization",
							accessToken.toString());
					OutputStream os = conn.getOutputStream();
					JsonGenerator g = new ObjectMapper().getFactory()
							.createGenerator(os,
									JsonEncoding.UTF8);
					g.writeStartObject();
					g.writeObjectField("params",
							Arrays.asList(Arrays.asList("KBH_3")));
					g.writeStringField("method", "AbstractHandle.are_readable");
					g.writeStringField("version", "1.1");
					g.writeStringField("id", "12345");
					g.writeEndObject();
					g.close();
					os.flush();
					System.out.print(conn.getResponseCode() + " ");
					System.out.println(conn.getResponseMessage());
				}
			} catch (Exception e) {
				System.out.println(e.getClass().getName() + ": " +
						e.getLocalizedMessage());
			}
			Thread.sleep(1000);
		}
	}
}
{'fraction_non_alphanumeric': 0.1550187617260788, 'fraction_numerical': 0.013836772983114446, 'mean_word_length': 3.8029279279279278, 'pattern_counts': {'":': 14, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '6423351', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1371, 'n_words': 261}