[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Take out redirects that were added 19 months ago.



commit 62ce743e4cb44a70f355f4529c03903a88b1c628
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Mar 8 15:53:58 2012 +0100

    Take out redirects that were added 19 months ago.
---
 etc/web.xml                                       |   43 -------------------
 src/org/torproject/ernie/web/RedirectServlet.java |   47 ---------------------
 2 files changed, 0 insertions(+), 90 deletions(-)

diff --git a/etc/web.xml b/etc/web.xml
index 8454e95..417ab62 100644
--- a/etc/web.xml
+++ b/etc/web.xml
@@ -332,49 +332,6 @@
   </servlet-mapping>
 
   <servlet>
-    <servlet-name>Redirect</servlet-name>
-    <servlet-class>
-      org.torproject.ernie.web.RedirectServlet
-    </servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/networksize.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/exit-relays-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/bridge-users-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/new-users-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/consensus-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/recurring-users-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/torperf-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/gettor-graphs.html</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Redirect</servlet-name>
-    <url-pattern>/custom-graph.html</url-pattern>
-  </servlet-mapping>
-
-  <servlet>
     <servlet-name>GraphData</servlet-name>
     <servlet-class>
       org.torproject.ernie.web.GraphDataServlet
diff --git a/src/org/torproject/ernie/web/RedirectServlet.java b/src/org/torproject/ernie/web/RedirectServlet.java
deleted file mode 100644
index 6b5e2be..0000000
--- a/src/org/torproject/ernie/web/RedirectServlet.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.torproject.ernie.web;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.*;
-import java.util.*;
-
-public class RedirectServlet extends HttpServlet {
-
-  private Map<String, String> redirects;
-
-  public void init() {
-
-    /* Initialize map containing redirects. */
-    redirects = new HashMap<String, String>();
-    redirects.put("networksize.html", "/network.html");
-    redirects.put("exit-relays-graphs.html", "/network.html");
-    redirects.put("bridge-users-graphs.html", "/users.html");
-    redirects.put("new-users-graphs.html", "/users.html");
-    redirects.put("consensus-graphs.html", "/network.html");
-    redirects.put("recurring-users-graphs.html", "/users.html");
-    redirects.put("torperf-graphs.html", "/performance.html");
-    redirects.put("gettor-graphs.html", "/packages.html");
-    redirects.put("custom-graph.html", "/graphs.html");
-  }
-
-  public void doGet(HttpServletRequest request,
-      HttpServletResponse response) throws IOException, ServletException {
-
-    /* Find out which page was requested. */
-    String requestedPage = request.getRequestURI();
-    if (requestedPage.contains("/")) {
-      requestedPage = requestedPage.substring(requestedPage.
-          lastIndexOf("/") + 1);
-    }
-
-    /* Make sure we know where to redirect this request. */
-    if (!redirects.containsKey(requestedPage)) {
-      response.sendError(HttpServletResponse.SC_NOT_FOUND, requestedPage);
-      return;
-    }
-
-    /* Redirect the request. */
-    response.sendRedirect(redirects.get(requestedPage));
-  }
-}
-



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits