@@ -0,0 +1,1785 @@
+import java.io.*;%0Aimport java.net.*;%0A%0A%0A/**%0A * A simple Java Socket client that connects to the Grand Valley%0A * web server and requests documents.%0A * %0A * @author jsirianni%0A *%0A */%0Apublic class GvsuClient %7B%0A%09%0A%09%0A%09/*%0A%09 * Methods taken from SampleCode/IOStreams/WrappingInputStreams.java%0A%09 * Modified to do Input and Output streams%0A%09 */%0A%09public static DataInputStream wrapInputStream(InputStream in) throws IOException %7B%0A%09   BufferedInputStream x = new BufferedInputStream(in);%0A%09   DataInputStream y = new DataInputStream(x);%0A%09   return y;%0A%09%7D%0A%09public static DataOutputStream wrapOutputStream(OutputStream in) throws IOException %7B%0A%09%09BufferedOutputStream x = new BufferedOutputStream(in);%0A%09%09DataOutputStream y = new DataOutputStream(x);%0A%09%09return y;%0A%09%7D%0A%09%0A%09%0A%09%0A%09/*%0A%09 * Main method - Creates a client socket, connecting to www.cis.gvsu.edu%0A%09 * Calls the wrapItUp method to get a DataInputStream for file downloads%0A%09 */%0A%09@SuppressWarnings(%7B %22unused%22, %22resource%22 %7D)%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09%0A%09%09%0A%09%09// Global Variables%0A%09%09String fqdn = %22www.cis.gvsu.edu%22;%0A%09%09int port = 80;%0A%09%09String filePath = %22/~kurmasz/Humor/stupid.html%22;%0A%09%09%0A%09%09%0A%09%09// Optionally pass an argument to select a file path%0A%09%09if (args.length != 0) %7B%0A%09%09%09filePath = args%5B0%5D;%0A%09%09%7D%0A%09%09%0A%09%09%0A%09%09// Client socket to connect to www.cis.gvsu.edu%0A%09%09Socket clientSocket = new Socket(fqdn, port);%0A%09%09%0A%09%09%0A%09%09// Create a wrapped DataInputStream & DataOutputStream%0A%09%09DataInputStream wrappedClientIn =%0A%09%09%09%09wrapInputStream(clientSocket.getInputStream());%09%09%09%0A%09%09%0A%09%09DataOutputStream wrappedclientOut = %0A%09%09%09%09wrapOutputStream(clientSocket.getOutputStream());%0A%09%09%0A%09%0A%09%09// Perform HTTP GET request%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%09%09%0A%09%7D%0A%0A%7D%0A

add assignment class