asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: Some more servlet cleanup
Date Fri, 24 Feb 2017 23:31:01 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 4e90aac56 -> 0f84c2179


Some more servlet cleanup

Change-Id: I9ba2895f1c3d52e30c90ab3cdbe9b6db17e56aa3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1526
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>


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

Branch: refs/heads/master
Commit: 0f84c2179e887955dc9f64c2733fbd4e90202186
Parents: 4e90aac
Author: Till Westmann <tillw@apache.org>
Authored: Thu Feb 23 15:04:31 2017 -0800
Committer: Till Westmann <tillw@apache.org>
Committed: Fri Feb 24 15:29:43 2017 -0800

----------------------------------------------------------------------
 .../cc/web/util/JSONOutputRequestHandler.java   |  6 +-----
 .../http/server/StaticResourceServlet.java      | 21 +-------------------
 2 files changed, 2 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f84c217/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
index c6c76dd..25ceaff 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
@@ -45,11 +45,7 @@ public class JSONOutputRequestHandler extends AbstractServlet {
     }
 
     @Override
-    public void handle(IServletRequest request, IServletResponse response) {
-        if (request.getHttpRequest().method() != HttpMethod.GET) {
-            response.setStatus(HttpResponseStatus.METHOD_NOT_ALLOWED);
-            return;
-        }
+    protected void get(IServletRequest request, IServletResponse response) {
         String path = path(request);
         while (path.startsWith("/")) {
             path = path.substring(1);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0f84c217/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
index 046b124..4d564ba 100644
--- a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
+++ b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
@@ -42,22 +42,7 @@ public class StaticResourceServlet extends AbstractServlet {
     }
 
     @Override
-    public void handle(IServletRequest request, IServletResponse response) {
-        try {
-            if (request.getHttpRequest().method() == HttpMethod.GET) {
-                doGet(request, response);
-            } else if (request.getHttpRequest().method() == HttpMethod.POST) {
-                doPost(request, response);
-            } else {
-                response.setStatus(HttpResponseStatus.METHOD_NOT_ALLOWED);
-            }
-        } catch (IOException e) {
-            LOGGER.log(Level.WARNING, "Failure setting content type", e);
-            response.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
-        }
-    }
-
-    protected void doGet(IServletRequest request, IServletResponse response) throws IOException
{
+    protected void get(IServletRequest request, IServletResponse response) throws IOException
{
         String resourcePath = request.getHttpRequest().uri();
         deliverResource(resourcePath, response);
     }
@@ -90,10 +75,6 @@ public class StaticResourceServlet extends AbstractServlet {
         }
     }
 
-    protected void doPost(IServletRequest request, IServletResponse response) throws IOException
{
-        response.setStatus(HttpResponseStatus.METHOD_NOT_ALLOWED);
-    }
-
     public static String extension(String path) {
         int i = path.lastIndexOf('.');
         return i < 1 ? "" : path.substring(i);


Mime
View raw message