From c12ba1013f2368571465da34f07d8b1d50361a9b Mon Sep 17 00:00:00 2001
From: Les Vogel Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.example.appengine.analytics;
import com.google.appengine.api.urlfetch.URLFetchService;
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
-
-import org.apache.http.client.utils.URIBuilder;
-
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.http.client.utils.URIBuilder;
// [START example]
@SuppressWarnings("serial")
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
-@WebServlet(name = "analytics", description = "Analytics: Send Analytics Event to Google Analytics",
- urlPatterns = "/analytics")
+@WebServlet(
+ name = "analytics",
+ description = "Analytics: Send Analytics Event to Google Analytics",
+ urlPatterns = "/analytics"
+)
public class AnalyticsServlet extends HttpServlet {
@Override
- public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException,
- ServletException {
+ public void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws IOException, ServletException {
String trackingId = System.getenv("GA_TRACKING_ID");
URIBuilder builder = new URIBuilder();
- builder.setScheme("http").setHost("www.google-analytics.com").setPath("/collect")
+ builder
+ .setScheme("http")
+ .setHost("www.google-analytics.com")
+ .setPath("/collect")
.addParameter("v", "1") // API Version.
.addParameter("tid", trackingId) // Tracking ID / Property ID.
// Anonymous Client Identifier. Ideally, this should be a UUID that
diff --git a/appengine-java8/users/src/main/java/com/example/appengine/users/UsersServlet.java b/appengine-java8/users/src/main/java/com/example/appengine/users/UsersServlet.java
index 2752793c520..a4b7e298d93 100644
--- a/appengine-java8/users/src/main/java/com/example/appengine/users/UsersServlet.java
+++ b/appengine-java8/users/src/main/java/com/example/appengine/users/UsersServlet.java
@@ -18,38 +18,39 @@
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
-
import java.io.IOException;
-
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// With @WebServlet annotation the webapp/WEB-INF/web.xml is no longer required.
-@WebServlet(name = "UserAPI", description = "UserAPI: Login / Logout with UserService",
- urlPatterns = "/userapi")
+@WebServlet(
+ name = "UserAPI",
+ description = "UserAPI: Login / Logout with UserService",
+ urlPatterns = "/userapi"
+)
public class UsersServlet extends HttpServlet {
@Override
- public void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
UserService userService = UserServiceFactory.getUserService();
String thisUrl = req.getRequestURI();
resp.setContentType("text/html");
if (req.getUserPrincipal() != null) {
- resp.getWriter().println(" Hello, "
- + req.getUserPrincipal().getName()
- + "! You can sign out. Hello, "
+ + req.getUserPrincipal().getName()
+ + "! You can sign out. Please sign in. Please sign in. Please .
Hello, " + FAKE_NAME + "!");
- assertThat(responseWriter.toString())
- .named("UsersServlet response")
- .contains("sign out");
+ assertThat(responseWriter.toString()).named("UsersServlet response").contains("sign out");
}
}
diff --git a/flexible/postgres/pom.xml b/flexible/postgres/pom.xml
index 8ab2b6b78ac..cac3699752b 100644
--- a/flexible/postgres/pom.xml
+++ b/flexible/postgres/pom.xml
@@ -37,7 +37,7 @@