Removed legacy logging&settings servlets.

This commit is contained in:
dev
2011-07-22 09:01:45 +00:00
parent d54dce8c25
commit 9e61a99c6d
3 changed files with 0 additions and 117 deletions

View File

@ -127,9 +127,7 @@ public class I2PControlController{
server.addListener(ssl);
ServletHttpContext context = (ServletHttpContext) server.getContext("/");
context.addServlet("/", "net.i2p.i2pcontrol.servlets.SettingsServlet");
context.addServlet("/jsonrpc", "net.i2p.i2pcontrol.servlets.JSONRPC2Servlet");
context.addServlet("/logs", "net.i2p.i2pcontrol.servlets.LogServlet");
server.start();
return server;

View File

@ -1,64 +0,0 @@
package net.i2p.i2pcontrol.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.i2p.I2PAppContext;
import net.i2p.util.Log;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class LogServlet extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = -4018705582081424641L;
private static Log _log;
@Override
public void init(){
_log = I2PAppContext.getGlobalContext().logManager().getLog(LogServlet.class);
}
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
{
httpServletResponse.setContentType("text/html");
PrintWriter out = httpServletResponse.getWriter();
out.println("<html>\n<body>");
out.println("<h2>Logs</h2>");
out.println("<h3>Most recent: </h3>\r\n<br><pre>");
List<String> strs = I2PAppContext.getGlobalContext().logManager().getBuffer().getMostRecentMessages();
for (String s : strs){
out.println(s);
}
out.println("</pre>\r\n<br>\r\n<h3>Recent critical: </h3>\r\n<br><pre>");
strs = I2PAppContext.getGlobalContext().logManager().getBuffer().getMostRecentCriticalMessages();
for (String s : strs){
out.println(s);
}
out.println("\r\n<br></pre>\r\n</body>\n</html>");
out.close();
}
}

View File

@ -1,51 +0,0 @@
package net.i2p.i2pcontrol.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.i2p.I2PAppContext;
import net.i2p.util.Log;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class SettingsServlet extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = -4018705582081424641L;
private static Log _log;
@Override
public void init(){
_log = I2PAppContext.getGlobalContext().logManager().getLog(SettingsServlet.class);
}
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
{
httpServletResponse.setContentType("text/html");
PrintWriter out = httpServletResponse.getWriter();
out.println("Settings be here");
out.close();
}
}