<commit_before>import java.io.*;
import java.net.*;


/**
 * A simple Java Socket client that connects to the Grand Valley
 * web server and requests documents.
 * 
 * @author jsirianni
 *
 */
public class GvsuClient {
	
	
	
	/*
	 * Methods taken from SampleCode/IOStreams/WrappingInputStreams.java
	 * Modified to do Input and Output streams
	 */
	public static DataInputStream wrapInputStream(InputStream in) throws IOException {
	   BufferedInputStream x = new BufferedInputStream(in);
	   DataInputStream y = new DataInputStream(x);
	   return y;
	}   
	public static DataOutputStream wrapOutputStream(OutputStream in) throws IOException {
		BufferedOutputStream x = new BufferedOutputStream(in);
		DataOutputStream y = new DataOutputStream(x);
		return y;
	}	
	
	
	
	/*
	 * Main method - Creates a client socket, connecting to www.cis.gvsu.edu
	 * Calls the wrapItUp method to get a DataInputStream for file downloads
	 */
	@SuppressWarnings({ "resource", "deprecation" })
	public static void main(String[] args) throws IOException {
	
		
		
		// Global Variables
		String fqdn = "www.cis.gvsu.edu";
		String filePath = "/~kurmasz/Humor/stupid.html";
		int port = 80;

		
		
		/*
		 * Optionally pass an argument to select a file path
		 * The path must start with a "/" and will be appended to 
		 * the end of the URL "www.cis.gvsu.edu"
		 */
		if (args.length != 0) {
			filePath = args[0];
		}
		
		
		
		// Client socket to connect to www.cis.gvsu.edu
		Socket clientSocket = new Socket(fqdn, port);

		
		
		// Create a wrapped DataOutputStream & DataInputStream 
		DataOutputStream wrappedClientOut = (wrapOutputStream(clientSocket.getOutputStream()));
		DataInputStream wrappedClientIn = (wrapInputStream(clientSocket.getInputStream()));			
		
		
		
		// Create GET 
		String get = ("GET " + filePath + " HTTP/1.1\r\nHost: " + fqdn + "\r\n\r\n");

		
		
		// Send the request to the server, then flush
		wrappedClientOut.writeBytes(get);
		wrappedClientOut.flush();

		
		
		
		// Read HTML response
		String httpResponse = "";

		do {
			httpResponse = wrappedClientIn.readLine();
			System.out.println(httpResponse);
		} while (!httpResponse.isEmpty());
			
		

		
		// FLUSH HERE??
		
		
		
		
		
		
			
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				
	}

}
<commit_msg>request working<commit_after>import java.io.*;
import java.net.*;


/**
 * A simple Java Socket client that connects to the Grand Valley
 * web server and requests documents.
 * 
 * @author jsirianni
 *
 */
public class GvsuClient {
	
	
	
	/*
	 * Methods taken from SampleCode/IOStreams/WrappingInputStreams.java
	 * Modified to do Input and Output streams
	 */
	public static DataInputStream wrapInputStream(InputStream in) throws IOException {
	   BufferedInputStream x = new BufferedInputStream(in);
	   DataInputStream y = new DataInputStream(x);
	   return y;
	}   
	public static DataOutputStream wrapOutputStream(OutputStream in) throws IOException {
		BufferedOutputStream x = new BufferedOutputStream(in);
		DataOutputStream y = new DataOutputStream(x);
		return y;
	}	
	
	
	
	/*
	 * Main method - Creates a client socket, connecting to www.cis.gvsu.edu
	 * Calls the wrapItUp method to get a DataInputStream for file downloads
	 */
	@SuppressWarnings({ "resource", "deprecation" })
	public static void main(String[] args) throws IOException {
	
		
		
		// Global Variables
		String fqdn = "www.cis.gvsu.edu";
		String filePath = "/~kurmasz/Humor/stupid.html";
		int port = 80;

		
		
		/*
		 * Optionally pass an argument to select a file path
		 * The path must start with a "/" and will be appended to 
		 * the end of the URL "www.cis.gvsu.edu"
		 */
		if (args.length != 0) {
			filePath = args[0];
		}
		
		
		
		// Client socket to connect to www.cis.gvsu.edu
		Socket clientSocket = new Socket(fqdn, port);

		
		
		// Create a wrapped DataOutputStream & DataInputStream 
		DataOutputStream wrappedClientOut = (wrapOutputStream(clientSocket.getOutputStream()));
		DataInputStream wrappedClientIn = (wrapInputStream(clientSocket.getInputStream()));			
		
		
		
		// Create GET 
		String get = ("GET " + filePath + " HTTP/1.1\r\nHost: " + fqdn + "\r\n\r\n");

		
		
		// Send the request to the server, then flush
		wrappedClientOut.writeBytes(get);
		wrappedClientOut.flush();

		
		
		
		// Print response headers to the terminal
		String httpResponse = "";

		//do {
		//	httpResponse = wrappedClientIn.readLine();
		//	System.out.println(httpResponse);
		//} while (!httpResponse.isEmpty());
			

			
		while (true) {
			httpResponse = wrappedClientIn.readLine();
			if (httpResponse == null) {
				break;
			}
			else {
				System.out.println(httpResponse);

			}
		} 
		
		// FLUSH HERE??
		
		
		
		// Close Socket Here??
		
		
		
			
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				
	}

}

{'fraction_non_alphanumeric': 0.1015447991761071, 'fraction_numerical': 0.0024716786817713696, 'mean_word_length': 2.6401799100449774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1184014', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1414, 'n_words': 409}