public static void main(String[] args) throws Exception {
	File indir = new File("/srv/haven/errors");
	File outdir = new File("/srv/www/haven/errors");
	Map<File, Report> reports = new HashMap<File, Report>();
	Map<File, Exception> failed = new HashMap<File, Exception>();
	
	for(File f : indir.listFiles()) {
	    if(f.getName().startsWith("err")) {
		try {
		    ObjectInputStream in = new ObjectInputStream(new FileInputStream(f));
		    try {
			reports.put(f, (Report)in.readObject());
		    } finally {
			in.close();
		    }
		} catch(Exception e) {
		    failed.put(f, e);
		}
	    }
	}
	
	OutputStream out;
	out = new FileOutputStream(new File(outdir, "index.html"));
	try {
	    makeindex(out, reports, failed);
	} finally {
	    out.close();
	}
	
	for(File f : reports.keySet()) {
	    out = new FileOutputStream(new File(outdir, f.getName() + ".html"));
	    try {
		makereport(out, reports.get(f));
	    } finally {
		out.close();
	    }
	}
    }