sb.append("</ul>");
sb.append("</table>");
    public static String list(File file) {        StringBuffer sb = new StringBuffer();        sb.append("<html>");        sb.append("<head>");        sb.append("<title>Directory listing of ");        sb.append(file.getPath());        sb.append("</title>");        sb.append("<style>");        sb.append("ul { background-color: #ddffdd; }");        sb.append("li { list-style-type: none; }");        sb.append("a { text-decoration: none; }");        sb.append(".dir { font-weight: bold; color: #ff9966; }");        sb.append(".file { font-weight: normal; color: #003333; }");        sb.append("</style>");        sb.append("</head>");        sb.append("<body>");        sb.append("<p>the contents of ");        sb.append(file.toString());        sb.append(" are:</p>");        if (file.isDirectory()) {            sb.append("<ul>");            File[] files = file.listFiles();            for (int i = 0; i < files.length; i++) {                sb.append("<li>");                if (files[i].isDirectory()) {                    sb.append("<a class='dir' href='" + files[i].getAbsolutePath() + "'>" + files[i].getName() + "</a>");                } else {                    sb.append("<a class='file' href='" + files[i].getAbsolutePath() + "'>" + files[i].getName() + "</a>");                }                sb.append("</li>");            }            sb.append("</ul>");        }        sb.append("</body></html>");        return sb.toString();    }