public static void sendDirs(Socket socket, Vector<String> vector){
        PrintWriter out = null;
        try {
            out = new PrintWriter(socket.getOutputStream());
        } catch (IOException e) {
            System.err.println("Cannot get output stream of socket");
            System.exit(-14);
        }
        // Tell the client how many dirs we are going to send
        out.println(vector.size());
        for(String dirName : vector){
            System.out.println("sending dir " + dirName);
            // Print each dirname to the client
            out.println(dirName);
        }   
        out.flush();
    }