if (done()) return null;
FileInputStream fis = null;
try {
- return new Headers(new Stream(new FileInputStream(file())));
+ return new Headers.Original(new Stream(new FileInputStream(file())));
} catch (IOException e) { throw new MailException.IOException(e);
} finally { if (fis != null) try { fis.close(); } catch (Exception e) { /* DELIBERATE */ } }
}
}
public static class Servlet extends HttpServlet {
- public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {doGet(request, response);}
+ public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { doGet(request, response); }
private void frames(HttpServletRequest request, HttpServletResponse response, boolean top) throws IOException {
String basename = request.getServletPath();
PrintWriter pw = new PrintWriter(response.getWriter());
pw.println("<html>");
if (top) {
- pw.println(" <frameset rows='30%,*'>");
+ pw.println(" <frameset rows='10%,30%,*'>");
+ pw.println(" <frame src='"+basename+"?frame=banner' marginwidth=0 marginheight=0 name=banner/>");
pw.println(" <frame src='"+basename+"?frame=top' marginwidth=0 marginheight=0 name=top/>");
pw.println(" <frame src='"+basename+"?frame=bottom' marginwidth=0 marginheight=0 name='bottom'/>");
} else {
if (frame == null) { frames(request, response, true); return; }
if (frame.equals("top")) { frames(request, response, false); return; }
+ if (frame.equals("banner")) { banner(request, response); return; }
if (frame.equals("topleft")) { return; }
if (request.getServletPath().indexOf("..") != -1) throw new IOException(".. not allowed in image paths");
pw.println(" </pre>");
pw.println(" </body>");
pw.println("</html>");
+ pw.flush();
+ pw.close();
}
+ private void banner(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ String basename = request.getServletPath();
+ String realpath = getServletContext().getRealPath(basename);
+ MailingList list = MailingList.getMailingList(realpath);
+ list.banner(request, response);
+ }
+
private void topright(HttpServletRequest request, HttpServletResponse response, String[][] messages) throws IOException {
PrintWriter pw = new PrintWriter(response.getWriter());
String basename = request.getServletPath();
pw.println(" </table>");
pw.println(" </body>");
pw.println("</html>");
+ pw.flush();
+ pw.close();
}
}
}