accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject git commit: ACCUMULO-2067 Use urlencoding method already present in BasicServlet (thanks, [~ecn]).
Date Fri, 20 Dec 2013 18:07:38 GMT
Updated Branches:
  refs/heads/1.6.0-SNAPSHOT 6bf68ed0d -> 4cf60b651


ACCUMULO-2067 Use urlencoding method already present in BasicServlet (thanks, [~ecn]).


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 4cf60b651fa86c6ac2a6e9501dbdd2ae5467ff8f
Parents: 6bf68ed
Author: Josh Elser <elserj@apache.org>
Authored: Fri Dec 20 13:06:48 2013 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Dec 20 13:06:48 2013 -0500

----------------------------------------------------------------------
 .../monitor/util/celltypes/TableLinkType.java         | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4cf60b65/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/TableLinkType.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/TableLinkType.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/TableLinkType.java
index 39a932e..76041d4 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/TableLinkType.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/TableLinkType.java
@@ -16,18 +16,14 @@
  */
 package org.apache.accumulo.monitor.util.celltypes;
 
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
 import java.util.Map;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.impl.Tables;
+import org.apache.accumulo.monitor.servlets.BasicServlet;
 import org.apache.accumulo.server.client.HdfsZooInstance;
-import org.apache.log4j.Logger;
 
 public class TableLinkType extends CellType<String> {
   
-  private static final Logger log = Logger.getLogger(TableLinkType.class);
   private Map<String,String> tidToNameMap;
   
   public TableLinkType() {
@@ -39,15 +35,9 @@ public class TableLinkType extends CellType<String> {
     if (obj == null)
       return "-";
     String tableId = (String) obj;
-    String encodedTableId = tableId;
     // Encode the tableid we use in the link so we construct a correct url
     // e.g. the root table's id of "+r" would not be interpreted properly
-    try {
-      encodedTableId = URLEncoder.encode(tableId, Constants.UTF8.name());
-    } catch (UnsupportedEncodingException e) {
-      log.error("Could not urlencode tableId: " + encodedTableId);
-    }
-    return String.format("<a href='/tables?t=%s'>%s</a>", encodedTableId, displayName(tableId));
+    return String.format("<a href='/tables?t=%s'>%s</a>", BasicServlet.encode(tableId),
displayName(tableId));
   }
   
   private String displayName(String tableId) {


Mime
View raw message