hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r521912 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/StatusHttpServer.java
Date Fri, 23 Mar 2007 21:41:56 GMT
Author: cutting
Date: Fri Mar 23 14:41:55 2007
New Revision: 521912

URL: http://svn.apache.org/viewvc?view=rev&rev=521912
Log:
HADOOP-1137.  Fix StatusHttpServer to work correctly when resources are in a jar file.  Contributed
by Benjamin Reed.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=521912&r1=521911&r2=521912
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Mar 23 14:41:55 2007
@@ -24,6 +24,9 @@
  7. HADOOP-1064.  Reduce log level of some DFSClient messages.
     (Dhruba Borthakur via cutting)
 
+ 8. HADOOP-1137.  Fix StatusHttpServer to work correctly when
+    resources are in a jar file.  (Benjamin Reed via cutting)
+
 
 Release 0.12.2 - 2007-23-17
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java?view=diff&rev=521912&r1=521911&r2=521912
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java Fri Mar 23
14:41:55 2007
@@ -84,7 +84,7 @@
     String appDir = getWebAppsPath();
     HttpContext staticContext = new HttpContext();
     staticContext.setContextPath("/static/*");
-    staticContext.setResourceBase(appDir + File.separator + "static");
+    staticContext.setResourceBase(appDir + "/static");
     staticContext.addHandler(new ResourceHandler());
     webServer.addContext(staticContext);
 
@@ -149,21 +149,13 @@
   
   /**
    * Get the pathname to the webapps files.
-   * @return the pathname
+   * @return the pathname as a URL
    */
   private static String getWebAppsPath() throws IOException {
     URL url = StatusHttpServer.class.getClassLoader().getResource("webapps");
     if( url == null ) 
       throw new IOException("webapps not found in CLASSPATH"); 
-    String path = url.getPath();
-    if (isWindows && path.startsWith("/")) {
-      path = path.substring(1);
-      try {
-        path = URLDecoder.decode(path, "UTF-8");
-      } catch (UnsupportedEncodingException e) {
-      }
-    }
-    return new File(path).getCanonicalPath();
+    return url.toString();
   }
   
   /**



Mime
View raw message