public static void generateHashTable() throws Exception {
        File logDir = new File(logDirectory);
        if (!logDir.isDirectory()) {
            System.err.println(logDir.getPath() + " is not a dir");
            System.exit(-1);
        }

        File[] files = logDir.listFiles();
        for (File file : files) {

            byte[] d = new byte[(int) file.length()];
            DataInputStream dis = new DataInputStream(new FileInputStream(file));
            dis.readFully(d);
            dis.close();

            /* find header line */
            String sat[] = new String(d).split("\r\n");
            String headerLine = sat[0];
            /* find the end of the request */
            int pos = -1;
            for (int i = 0; i < d.length; i++) {
                if (d[i] == 13 && d[i + 1] == 10 && d[i + 2] == 13 && d[i + 3] == 10) {
                    pos = i + 4;
                    break;
                }
            }

            if (pos == -1) {
                System.err.println("could not find end of request headers");
                System.exit(-1);
            }

            byte[] response = Arrays.copyOfRange(d, pos, d.length);
            responseTable.put(headerLine, new HTTPResponse(response));
        }
    }