You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by wh...@apache.org on 2014/10/24 23:20:08 UTC

git commit: HADOOP-11231. Remove dead code in ServletUtil. Contributed by Li Lu.

Repository: hadoop
Updated Branches:
  refs/heads/trunk f81dc3f99 -> dc6e819ed


HADOOP-11231. Remove dead code in ServletUtil. Contributed by Li Lu.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/dc6e819e
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/dc6e819e
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/dc6e819e

Branch: refs/heads/trunk
Commit: dc6e819ed83494253c2527a8dfedabd8bc79a78b
Parents: f81dc3f
Author: Haohui Mai <wh...@apache.org>
Authored: Fri Oct 24 14:19:52 2014 -0700
Committer: Haohui Mai <wh...@apache.org>
Committed: Fri Oct 24 14:19:52 2014 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  2 +
 .../org/apache/hadoop/util/ServletUtil.java     | 81 --------------------
 2 files changed, 2 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/dc6e819e/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 5a5b0d4..c9c4246 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -359,6 +359,8 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11172. Improve error message in Shell#runCommand on OutOfMemoryError.
     (Yongjun Zhang via wang)
 
+    HADOOP-11231. Remove dead code in ServletUtil. (Li Lu via wheat9)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/dc6e819e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ServletUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ServletUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ServletUtil.java
index a401f3f..6a8ca0f 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ServletUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ServletUtil.java
@@ -23,8 +23,6 @@ import java.util.Calendar;
 import javax.servlet.*;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.commons.httpclient.URIException;
-import org.apache.commons.httpclient.util.URIUtil;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 
@@ -87,85 +85,6 @@ public class ServletUtil {
   public static String htmlFooter() {
     return HTML_TAIL;
   }
-  
-  /**
-   * Generate the percentage graph and returns HTML representation string
-   * of the same.
-   * 
-   * @param perc The percentage value for which graph is to be generated
-   * @param width The width of the display table
-   * @return HTML String representation of the percentage graph
-   * @throws IOException
-   */
-  public static String percentageGraph(int perc, int width) throws IOException {
-    assert perc >= 0; assert perc <= 100;
-
-    StringBuilder builder = new StringBuilder();
-
-    builder.append("<table border=\"1px\" width=\""); builder.append(width);
-    builder.append("px\"><tr>");
-    if(perc > 0) {
-      builder.append("<td cellspacing=\"0\" class=\"perc_filled\" width=\"");
-      builder.append(perc); builder.append("%\"></td>");
-    }if(perc < 100) {
-      builder.append("<td cellspacing=\"0\" class=\"perc_nonfilled\" width=\"");
-      builder.append(100 - perc); builder.append("%\"></td>");
-    }
-    builder.append("</tr></table>");
-    return builder.toString();
-  }
-  
-  /**
-   * Generate the percentage graph and returns HTML representation string
-   * of the same.
-   * @param perc The percentage value for which graph is to be generated
-   * @param width The width of the display table
-   * @return HTML String representation of the percentage graph
-   * @throws IOException
-   */
-  public static String percentageGraph(float perc, int width) throws IOException {
-    return percentageGraph((int)perc, width);
-  }
-
-  /**
-   * Escape and encode a string regarded as within the query component of an URI.
-   * @param value the value to encode
-   * @return encoded query, null if the default charset is not supported
-   */
-  public static String encodeQueryValue(final String value) {
-    try {
-      return URIUtil.encodeWithinQuery(value, "UTF-8");
-    } catch (URIException e) {
-      throw new AssertionError("JVM does not support UTF-8"); // should never happen!
-    }
-  }
-
-  /**
-   * Escape and encode a string regarded as the path component of an URI.
-   * @param path the path component to encode
-   * @return encoded path, null if UTF-8 is not supported
-   */
-  public static String encodePath(final String path) {
-    try {
-      return URIUtil.encodePath(path, "UTF-8");
-    } catch (URIException e) {
-      throw new AssertionError("JVM does not support UTF-8"); // should never happen!
-    }
-  }
-
-  /**
-   * Parse and decode the path component from the given request.
-   * @param request Http request to parse
-   * @param servletName the name of servlet that precedes the path
-   * @return decoded path component, null if UTF-8 is not supported
-   */
-  public static String getDecodedPath(final HttpServletRequest request, String servletName) {
-    try {
-      return URIUtil.decode(getRawPath(request, servletName), "UTF-8");
-    } catch (URIException e) {
-      throw new AssertionError("JVM does not support UTF-8"); // should never happen!
-    }
-  }
 
   /**
    * Parse the path component from the given request and return w/o decoding.