private static String getPath(BufferedReader in)     throws IOException
    {
        String line = in.readLine();
        String path = "";

        // extract class from GET line
        if (line.startsWith("GET /"))
        {
            line = line.substring(5, line.length()-1).trim();

            int index = line.indexOf(".class ");
            if (index != -1)
            {
                path = line.substring(0, index).replace('/', '.');
            }
        }

        // eat the rest of header
        do
        {
            line = in.readLine();

        } while ((line.length() != 0) && (line.charAt(0) != '\r') && (line.charAt(0) != '\n'));

        if (path.length() != 0)
        {
            return path;
        }
        else
        {
            throw new IOException("Malformed Header");
        }
    }