private String getContentTypeFromFilename(String file_name) {
        String extension = file_name.substring(file_name.lastIndexOf(".") + 1).toLowerCase();
        if ("html".equals(extension) || "htm".equals(extension)) return "text/html";
        else if ("css".equals(extension)) return "text/css";
        else if ("js".equals(extension)) return "text/javascript";
        else return "text/plain";
    }