asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Some more servlet cleanup
Date Fri, 24 Feb 2017 23:30:05 GMT
Till Westmann has submitted this change and it was merged.

Change subject: Some more servlet cleanup
......................................................................


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>
---
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/util/JSONOutputRequestHandler.java
M hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/StaticResourceServlet.java
2 files changed, 2 insertions(+), 25 deletions(-)

Approvals:
  abdullah alamoudi: Looks good to me, approved
  Jenkins: Verified; Verified

Objections:
  Jenkins: Violations found



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 @@
     }
 
     @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);
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 @@
     }
 
     @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);
     }
@@ -88,10 +73,6 @@
                 }
             }
         }
-    }
-
-    protected void doPost(IServletRequest request, IServletResponse response) throws IOException
{
-        response.setStatus(HttpResponseStatus.METHOD_NOT_ALLOWED);
     }
 
     public static String extension(String path) {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1526
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ba2895f1c3d52e30c90ab3cdbe9b6db17e56aa3
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message