From 59e0d0ac3e51156255792cea63c4381f03c24dd4 Mon Sep 17 00:00:00 2001 From: Ajay Kannan Date: Thu, 7 Jan 2016 13:52:46 -0800 Subject: [PATCH] Clean up servlet code and add in log settings file --- .../com/google/gcloud/tests/appengine/MainServlet.java | 9 ++------- .../src/main/webapp/WEB-INF/logging.properties | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 test-apps/app-engine-test-app/src/main/webapp/WEB-INF/logging.properties diff --git a/test-apps/app-engine-test-app/src/main/java/com/google/gcloud/tests/appengine/MainServlet.java b/test-apps/app-engine-test-app/src/main/java/com/google/gcloud/tests/appengine/MainServlet.java index 0e420df..6dec730 100644 --- a/test-apps/app-engine-test-app/src/main/java/com/google/gcloud/tests/appengine/MainServlet.java +++ b/test-apps/app-engine-test-app/src/main/java/com/google/gcloud/tests/appengine/MainServlet.java @@ -42,13 +42,8 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc if (pathInfo.length != 2) { printHelpMessage(responseWriter); } else { - Map params = req.getParameterMap(); - projectId = - params.get("project-id") != null ? ((String[]) params.get("project-id"))[0] : null; - Boolean useCredentialsFile = - params.get("credentials-file") != null - ? Boolean.parseBoolean(((String[]) params.get("credentials-file"))[0]) : null; - if (useCredentialsFile != null) { + projectId = req.getParameter("project-id"); + if (Boolean.parseBoolean(req.getParameter("credentials-file"))) { ServletContext context = getServletContext(); InputStream in = context.getResourceAsStream("/WEB-INF/lib/my-service-account-credentials.json"); diff --git a/test-apps/app-engine-test-app/src/main/webapp/WEB-INF/logging.properties b/test-apps/app-engine-test-app/src/main/webapp/WEB-INF/logging.properties new file mode 100644 index 0000000..a7f7870 --- /dev/null +++ b/test-apps/app-engine-test-app/src/main/webapp/WEB-INF/logging.properties @@ -0,0 +1 @@ +.level = INFO