<commit_before>package com.javanetworking;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.security.cert.Certificate;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;

public class URLRequest {

	private String url;
	private URLConnection urlConnection;
	private byte[] HTTPBody;

	
	public static URLRequest requestWithURLString(String url) {
		return new URLRequest(url);
	}
	
	
	public URLRequest(String url) {
		this.url = url;
		this.urlConnection = null;
		this.HTTPBody = null;
	}
	
	public byte[] getHTTPBody() {
		return HTTPBody;
	}

	public void setHTTPBody(byte[] hTTPBody) {
		HTTPBody = hTTPBody;
	}

	public URLConnection getURLConnection() {
		if (urlConnection == null) {
			try {
				urlConnection = new URL(this.url).openConnection();
			} catch (MalformedURLException e) {
				
			} catch (IOException e) {
				
			}
		}
		return urlConnection;
	}
	
	public HttpURLConnection getHttpURLConnection() {
		return ((HttpURLConnection)getURLConnection());
	}

	public void setRequestProperty(String key, String value) {
		getURLConnection().setRequestProperty(key, value);
	}

	public void setDoOutput(boolean b) {
		getURLConnection().setDoOutput(b);
	}

	public ByteArrayOutputStream getOutputStream() throws IOException {
		return (ByteArrayOutputStream) getURLConnection().getOutputStream();
	}

	public InputStream getInputStream() throws IOException {
		return getURLConnection().getInputStream();
	}

	public int getResponseCode() throws IOException {
		return getHttpURLConnection().getResponseCode();
	}

	public String getContentType() {
		return getHttpURLConnection().getContentType();
	}

	public void setRequestMethod(String method) {
		try {
			getHttpURLConnection().setRequestMethod(method);
		} catch (ProtocolException e) {}
	}

	public void setConnectTimeout(int timeout) {
		getHttpURLConnection().setReadTimeout(timeout);
	}
}<commit_msg>Added getHeaderFields method<commit_after>package com.javanetworking;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.security.cert.Certificate;
import java.util.List;
import java.util.Map;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;

public class URLRequest {

	private String url;
	private URLConnection urlConnection;
	private byte[] HTTPBody;

	
	public static URLRequest requestWithURLString(String url) {
		return new URLRequest(url);
	}
	
	
	public URLRequest(String url) {
		this.url = url;
		this.urlConnection = null;
		this.HTTPBody = null;
	}
	
	public byte[] getHTTPBody() {
		return HTTPBody;
	}

	public void setHTTPBody(byte[] hTTPBody) {
		HTTPBody = hTTPBody;
	}

	public URLConnection getURLConnection() {
		if (urlConnection == null) {
			try {
				urlConnection = new URL(this.url).openConnection();
			} catch (MalformedURLException e) {
				
			} catch (IOException e) {
				
			}
		}
		return urlConnection;
	}
	
	public HttpURLConnection getHttpURLConnection() {
		return ((HttpURLConnection)getURLConnection());
	}

	public void setRequestProperty(String key, String value) {
		getURLConnection().setRequestProperty(key, value);
	}

	public void setDoOutput(boolean b) {
		getURLConnection().setDoOutput(b);
	}

	public ByteArrayOutputStream getOutputStream() throws IOException {
		return (ByteArrayOutputStream) getURLConnection().getOutputStream();
	}

	public InputStream getInputStream() throws IOException {
		return getURLConnection().getInputStream();
	}

	public int getResponseCode() throws IOException {
		return getHttpURLConnection().getResponseCode();
	}

	public String getContentType() {
		return getHttpURLConnection().getContentType();
	}

	public void setRequestMethod(String method) {
		try {
			getHttpURLConnection().setRequestMethod(method);
		} catch (ProtocolException e) {}
	}

	public void setConnectTimeout(int timeout) {
		getHttpURLConnection().setReadTimeout(timeout);
	}

	public Map<String, List<String>> getHeaderFields() {
		return getHttpURLConnection().getHeaderFields();
	}
}
{'fraction_non_alphanumeric': 0.10060769750168805, 'fraction_numerical': 0.0, 'mean_word_length': 5.146611341632089, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2765180', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1274, 'n_words': 294}