1 4 5 9 10 package org.openlaszlo.servlets.responders; 11 12 import java.io.*; 13 import java.util.Properties ; 14 import javax.servlet.ServletConfig ; 15 import javax.servlet.ServletException ; 16 import javax.servlet.ServletOutputStream ; 17 import javax.servlet.http.HttpServletRequest ; 18 import javax.servlet.http.HttpServletResponse ; 19 import org.openlaszlo.utils.FileUtils; 20 import org.openlaszlo.server.LPS; 21 import org.apache.log4j.Logger; 22 23 public final class ResponderCLEARLOG extends ResponderAdmin 24 { 25 private static Logger mLogger = Logger.getLogger(ResponderCLEARLOG.class); 26 27 protected void respondAdmin(HttpServletRequest req, HttpServletResponse res) 28 throws IOException 29 { 30 String [] status = new String [1]; 31 status[0] = ""; 32 33 boolean cleared = ResponderLOGCONFIG.clearLog(status); 34 35 StringBuffer buf = new StringBuffer (); 36 buf.append("<clearlog ") 37 .append("cleared=\"").append(cleared).append("\" "); 38 if (status[0].intern() != "") { 39 buf.append("status=\"").append(status[0]).append("\" "); 40 } 41 buf.append(" />"); 42 43 respondWithXML(res, buf.toString()); 44 45 if (cleared) 46 mLogger.info("Cleared log."); 47 else 48 mLogger.info("Could not clear log."); 49 50 } 51 52 public int getMimeType() 53 { 54 return MIME_TYPE_XML; 55 } 56 } 57 | Popular Tags |