[RESOLVIDO] Codigo de web

Estou com um código visto em aula, tinha achado que tinha entendido, mas agora que fui mexer nele percebi que não to com grandes noções do que ele esta fazendo.
Alguém poderia me ajudar explicando esse codigo?

/* WebServer.java */

import java.io.*;
import java.net.*;
import java.util.*;
class WebServer {
   public static void main(String argv[]) throws Exception
   {
      String requestMessageLine;
      String fileName;
      ServerSocket listenSocket = new ServerSocket(6789);
      Socket connectionSocket = listenSocket.accept();
      BufferedReader inFromClient = 
         new BufferedReader(new InputStreamReader(
               connectionSocket.getInputStream()));
      DataOutputStream outToClient = 
         new DataOutputStream(
               connectionSocket.getOutputStream());
      requestMessageLine = inFromClient.readLine();
      StringTokenizer tokenizedLine = 
         new StringTokenizer(requestMessageLine);
      if (tokenizedLine.nextToken().equals("GET")){
         fileName = tokenizedLine.nextToken();
         if (fileName.startsWith("/") == true)
            fileName = fileName.substring(1);
         File file = new File(fileName);
         int numOfBytes = (int) file.length();
         FileInputStream inFile = new FileInputStream(fileName);
         byte[] fileInBytes = new byte[numOfBytes];
         inFile.read(fileInBytes);
         outToClient.writeBytes("HTTP/1.0 200 Document Follows\r\n");
         if (fileName.endsWith(".jpg"))
            outToClient.writeBytes("Content-Type: image/jpeg\r\n");
         if (fileName.endsWith(".gif"))
            outToClient.writeBytes("Content-Type: image/gif\r\n");
         outToClient.writeBytes("Content-Type: " + numOfBytes + "\r\n");
         outToClient.writeBytes("\r\n");
         outToClient.write(fileInBytes, 0, numOfBytes);
         connectionSocket.close();
      }
      else
         System.out.println("Bad Request Message");
   }
}

Comece a pegar o nome das funções e pesquisar no google.
Vai ajudar bastante.

Agora foi.
Dei uma olhada não só no google, mas tb a outras pessoas da faculdade.