GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update of Flexible folder and the top-level parent pom. (#1004) · edr1/java-docs-samples@8148785

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • flexible
    • README.md
    • analytics
      • pom.xml
      • src/main/java/com/example/analytics
        • AnalyticsServlet.java
    • async-rest
      • README.md
      • pom.xml
      • src/main/java/com/google/appengine/demos
        • DumpServlet.java
        • asyncrest
          • AbstractRestServlet.java
          • AsyncRestServlet.java
          • SerialRestServlet.java
    • cloud-tasks
      • README.md
      • pom.xml
      • src/main/java/com/example/cloudtasks
        • CreateTaskServlet.java
        • HelloServlet.java
        • TaskHandlerServlet.java
    • cloudsql
      • README.md
      • pom.xml
      • src/main
        • java/com/example/cloudsql
          • CloudSqlServlet.java
        • resources
          • config.properties
    • cloudstorage
      • README.md
      • pom.xml
      • src/main/java/com/example/cloudstorage
        • UploadServlet.java
    • cron
      • README.md
      • pom.xml
      • src/main/java/com/example/cron
        • CronServlet.java
    • datastore/src/main/java/com/example/datastore
      • DatastoreServlet.java
    • disk
      • pom.xml
      • src/main/java/com/example/disk
        • DiskServlet.java
    • endpoints
      • README.md
      • pom.xml
      • src/main/java/com/example/endpoints
        • AuthInfoServlet.java
        • EchoServlet.java
    • errorreporting
      • README.md
      • pom.xml
      • src/main/java/com/example/flexible/errorreporting
        • ErrorReportingExample.java
    • extending-runtime
      • README.md
      • pom.xml
      • src/main/java/com/example/extendingruntime
        • FortuneServlet.java
    • gaeinfo
      • README.md
      • pom.xml
      • src/main/java/com/example/appengine/flex_compat
        • GaeInfoServlet.java
    • helloworld
      • README.md
      • pom.xml
      • src/main/java/com/example/flexible/helloworld
        • HelloServlet.java
    • mailgun
      • README.md
      • pom.xml
      • src/main/java/com/example/mailgun
        • MailgunServlet.java
    • mailjet
      • README.md
      • pom.xml
      • src/main/java/com/example/mailjet
        • MailjetServlet.java
    • memcache
      • README.md
      • pom.xml
      • src/main/java/com/example/memcache
        • MemcacheServlet.java
    • pom.xml
    • postgres
      • README.md
      • pom.xml
      • src/main
        • java/com/example/postgres
          • PostgresSqlServlet.java
        • resources
          • config.properties
    • pubsub
      • README.md
      • pom.xml
      • src/main
        • java/com/example/flexible/pubsub
          • Message.java
          • MessageRepository.java
          • MessageRepositoryImpl.java
          • PubSubHome.java
          • PubSubPublish.java
          • PubSubPush.java
        • test/com/example/flexible/pubsub
          • PubSubPublishTest.java
          • PubSubPushTest.java
    • sendgrid
      • README.md
      • pom.xml
      • src/main/java/com/example/sendgrid
        • SendEmailServlet.java
    • sparkjava
      • README.md
      • pom.xml
      • src
        • main/java/com/google/appengine/sparkdemo
          • Main.java
          • ResponseError.java
          • User.java
          • UserController.java
          • UserService.java
        • test/java/com/google/appengine/sparkdemo
          • UserControllerTest.java
          • UserServiceTest.java
    • static-files
      • pom.xml
    • twilio
      • README.md
      • pom.xml
      • src/main/java/com/example/twilio
        • ReceiveCallServlet.java
        • ReceiveSmsServlet.java
        • SendSmsServlet.java
  • pom.xml
  • storage/xml-api
    • cmdline-sample
      • README.md
      • pom.xml
      • src/main/java
        • StorageSample.java
    • serviceaccount-appengine-sample
      • pom.xml
      • src/main
        • java/com/google/api/client/sample/storage/appengine/serviceaccount
          • StorageSample.java
        • resources
          • log4j.properties
  • vision/beta/cloud-client
    • README.md
    • pom.xml
    • src
      • main/java/com/example/vision
        • Detect.java
      • test/java/com/example/vision
        • DetectIT.java

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎flexible/README.md‎

Copy file name to clipboardExpand all lines: flexible/README.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Google App Engine Flexible Environment Java Samples
22

3+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=flexible/README.md">
4+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
5+
36
This is a repository that contains Java code samples for [Google App Engine
47
flexible environment][aeflex-docs].
58

Collapse file

‎flexible/analytics/pom.xml‎

Copy file name to clipboardExpand all lines: flexible/analytics/pom.xml
+10-5Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@
2020
<groupId>com.example.flexible</groupId>
2121
<artifactId>flexible-analytics</artifactId>
2222

23+
<!--
24+
The parent pom defines common style checks and testing strategies for our samples.
25+
Removing or replacing it should not affect the execution of the samples in anyway.
26+
-->
2327
<parent>
24-
<artifactId>appengine-flexible</artifactId>
25-
<groupId>com.google.cloud</groupId>
26-
<version>1.0.0</version>
27-
<relativePath>..</relativePath>
28+
<groupId>com.google.cloud.samples</groupId>
29+
<artifactId>shared-configuration</artifactId>
30+
<version>1.0.8</version>
2831
</parent>
2932

3033
<properties>
34+
<maven.compiler.target>1.8</maven.compiler.target>
35+
<maven.compiler.source>1.8</maven.compiler.source>
36+
3137
<appengine.maven.plugin>1.3.2</appengine.maven.plugin>
3238
<jetty>9.4.4.v20170414</jetty>
33-
3439
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
3540
</properties>
3641

Collapse file

‎flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java‎

Copy file name to clipboardExpand all lines: flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/*
22
* Copyright 2015 Google Inc.
33
*
4-
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5-
* except in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
67
*
7-
* <p>http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
89
*
9-
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
10-
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11-
* express or implied. See the License for the specific language governing permissions and
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
1214
* limitations under the License.
1315
*/
16+
1417
package com.example.analytics;
1518

1619
import java.io.IOException;
Collapse file

‎flexible/async-rest/README.md‎

Copy file name to clipboardExpand all lines: flexible/async-rest/README.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
# Example Web App Using Asynchronous Servlets #
33

4+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=flexible/async-rest/README.md">
5+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
6+
7+
48
This web app demonstrates using asynchronous servlet techniques to reduce server resources.
59

610
The code for this tutorial is [here](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/flexible/async-rest).
Collapse file

‎flexible/async-rest/pom.xml‎

Copy file name to clipboardExpand all lines: flexible/async-rest/pom.xml
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
<version>1.0.0-SNAPSHOT</version>
2222
<packaging>war</packaging>
2323

24+
<!--
25+
The parent pom defines common style checks and testing strategies for our samples.
26+
Removing or replacing it should not affect the execution of the samples in anyway.
27+
-->
2428
<parent>
25-
<artifactId>appengine-flexible</artifactId>
26-
<groupId>com.google.cloud</groupId>
27-
<version>1.0.0</version>
28-
<relativePath>..</relativePath>
29+
<groupId>com.google.cloud.samples</groupId>
30+
<artifactId>shared-configuration</artifactId>
31+
<version>1.0.8</version>
2932
</parent>
3033

3134
<properties>
Collapse file

‎flexible/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java‎

Copy file name to clipboardExpand all lines: flexible/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.IOException;
2020
import java.io.PrintWriter;
2121
import java.util.Collections;
22-
2322
import javax.servlet.ServletException;
2423
import javax.servlet.http.HttpServlet;
2524
import javax.servlet.http.HttpServletRequest;
Collapse file

‎flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java‎

Copy file name to clipboardExpand all lines: flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.Iterator;
2424
import java.util.Map;
2525
import java.util.Queue;
26-
2726
import javax.servlet.ServletConfig;
2827
import javax.servlet.ServletException;
2928
import javax.servlet.UnavailableException;
Collapse file

‎flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java‎

Copy file name to clipboardExpand all lines: flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java
+10-12Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,26 @@
1616

1717
package com.google.appengine.demos.asyncrest;
1818

19-
import org.eclipse.jetty.client.HttpClient;
20-
import org.eclipse.jetty.client.api.Response;
21-
import org.eclipse.jetty.client.api.Result;
22-
import org.eclipse.jetty.http.HttpMethod;
23-
import org.eclipse.jetty.util.BufferUtil;
24-
import org.eclipse.jetty.util.Utf8StringBuilder;
25-
import org.eclipse.jetty.util.ajax.JSON;
26-
import org.eclipse.jetty.util.ssl.SslContextFactory;
27-
2819
import java.io.IOException;
2920
import java.io.PrintWriter;
3021
import java.nio.ByteBuffer;
3122
import java.util.Map;
3223
import java.util.Queue;
3324
import java.util.concurrent.ConcurrentLinkedQueue;
3425
import java.util.concurrent.atomic.AtomicInteger;
35-
3626
import javax.servlet.AsyncContext;
3727
import javax.servlet.ServletConfig;
3828
import javax.servlet.ServletException;
3929
import javax.servlet.http.HttpServletRequest;
4030
import javax.servlet.http.HttpServletResponse;
31+
import org.eclipse.jetty.client.HttpClient;
32+
import org.eclipse.jetty.client.api.Response;
33+
import org.eclipse.jetty.client.api.Result;
34+
import org.eclipse.jetty.http.HttpMethod;
35+
import org.eclipse.jetty.util.BufferUtil;
36+
import org.eclipse.jetty.util.Utf8StringBuilder;
37+
import org.eclipse.jetty.util.ajax.JSON;
38+
import org.eclipse.jetty.util.ssl.SslContextFactory;
4139

4240
/**
4341
* Servlet which makes REST calls asynchronously.
@@ -134,8 +132,6 @@ void doComplete() {
134132

135133
// We have results!
136134
// Generate the response
137-
String thumbs = generateResults(results);
138-
139135
response.setContentType("text/html");
140136
PrintWriter out = response.getWriter();
141137
out.println("<html><head>");
@@ -176,6 +172,8 @@ void doComplete() {
176172

177173
out.println("<br/>");
178174
out.print("First 5 results of " + results.size() + ":<br/>");
175+
176+
String thumbs = generateResults(results);
179177
if ("".equals(thumbs)) {
180178
out.print("<i>No results. Ensure " + APPKEY + " property is set correctly.</i>");
181179
} else {
Collapse file

‎flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java‎

Copy file name to clipboardExpand all lines: flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.google.appengine.demos.asyncrest;
1818

19-
import org.eclipse.jetty.util.ajax.JSON;
20-
2119
import java.io.BufferedReader;
2220
import java.io.IOException;
2321
import java.io.InputStreamReader;
@@ -27,10 +25,10 @@
2725
import java.util.LinkedList;
2826
import java.util.Map;
2927
import java.util.Queue;
30-
3128
import javax.servlet.ServletException;
3229
import javax.servlet.http.HttpServletRequest;
3330
import javax.servlet.http.HttpServletResponse;
31+
import org.eclipse.jetty.util.ajax.JSON;
3432

3533
/**
3634
* Servlet which makes REST calls serially.
@@ -41,17 +39,21 @@
4139
* <dd>The Google app key to use</dd>
4240
* </dl>
4341
*/
42+
4443
public class SerialRestServlet extends AbstractRestServlet {
4544

45+
//CHECKSTYLE OFF: VariableDeclarationUsageDistance
4646
@Override
4747
protected void doGet(HttpServletRequest request, HttpServletResponse response)
4848
throws ServletException, IOException {
4949
if (key == null) {
5050
response.sendError(500, APPKEY + " not set");
5151
return;
5252
}
53+
5354
long start = System.nanoTime();
5455

56+
5557
String loc = sanitize(request.getParameter(LOC_PARAM));
5658
String lat = sanitize(request.getParameter(LATITUDE_PARAM));
5759
String longitude = sanitize(request.getParameter(LONGITUDE_PARAM));
@@ -118,6 +120,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
118120
out.println("</body></html>");
119121
out.close();
120122
}
123+
//CHECKSTYLE ON: VariableDeclarationUsageDistance
121124

122125
/**
123126
* Handle HTTP POST request.
@@ -130,4 +133,4 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
130133
doGet(request, response);
131134
}
132135

133-
}
136+
}
Collapse file

‎flexible/cloud-tasks/README.md‎

Copy file name to clipboardExpand all lines: flexible/cloud-tasks/README.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Google Cloud Tasks App Engine Flexible Queue Samples
22

3+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=flexible/cloud-tasks/README.md">
4+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
5+
36
This is a sample AppEngine app demonstrating use of the Cloud Tasks API
47
using App Engine Queues.
58

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.