diff --git a/flexible/analytics/pom.xml b/flexible/analytics/pom.xml deleted file mode 100644 index 184d180a3c6..00000000000 --- a/flexible/analytics/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - flexible-analytics - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - 3.3.9 - - - - - org.apache.httpcomponents - httpclient - 4.5.3 - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/analytics/src/main/appengine/app.yaml b/flexible/analytics/src/main/appengine/app.yaml deleted file mode 100644 index 3273b02a0e8..00000000000 --- a/flexible/analytics/src/main/appengine/app.yaml +++ /dev/null @@ -1,11 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - GA_TRACKING_ID: YOUR-GA-TRACKING-ID -# [END env_variables] diff --git a/flexible/cloudsql/.gitignore b/flexible/cloudsql/.gitignore deleted file mode 100644 index 83926cdbcaa..00000000000 --- a/flexible/cloudsql/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -target diff --git a/flexible/cloudsql/README.md b/flexible/cloudsql/README.md deleted file mode 100644 index d2c3f3e6e67..00000000000 --- a/flexible/cloudsql/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Cloud SQL sample for Google App Engine Flexible -This sample demonstrates how to use [Cloud SQL](https://cloud.google.com/sql/) on Google App Engine -Flexible. - -## Setup -Before you can run or deploy the sample, you will need to create a [Cloud SQL instance)](https://cloud.google.com/sql/docs/create-instance) - -1. Create a new user and database for the application. The easiest way to do this is via the [Google -Developers Console](https://console.cloud.google.com/sql/instances). Alternatively, you can use -MySQL tools such as the command line client or workbench. -2. Change the root password (under Access Control) and / or create a new user / password. -3. Create a Database (under Databases) (or use MySQL with `gcloud sql connect --user=root`) -4. Note the **Instance connection name** under Overview > Properties -(It will look like project:region:zone for 2nd Generation) - -## Deploying - -```bash -$ mvn clean appengine:deploy -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root --Dpassword=myPassword -Ddatabase=myDatabase -``` - -Or you can update the properties in `pom.xml` - -## Running locally - -```bash -$ mvn clean jetty:run -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase -``` diff --git a/flexible/cloudsql/pom.xml b/flexible/cloudsql/pom.xml deleted file mode 100644 index f9c20800396..00000000000 --- a/flexible/cloudsql/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - flexible-cloudsql - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - - - - root - - sqldemo - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - jdbc:mysql://google/${database}?cloudSqlInstance=${INSTANCE_CONNECTION_NAME}&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=${user}&password=${password}&useSSL=false - - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - mysql - mysql-connector-java - 6.0.5 - - - com.google.cloud.sql - mysql-socket-factory-connector-j-6 - 1.0.2 - - - - - - - src/main/resources - true - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - - - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/cloudsql/src/main/appengine/app.yaml b/flexible/cloudsql/src/main/appengine/app.yaml deleted file mode 100644 index ca251053293..00000000000 --- a/flexible/cloudsql/src/main/appengine/app.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2016 Google Inc. -# -# 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 -# -# 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. - -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -automatic_scaling: - min_num_instances: 1 - max_num_instances: 2 diff --git a/flexible/cloudstorage/pom.xml b/flexible/cloudstorage/pom.xml deleted file mode 100644 index 1835dadcfad..00000000000 --- a/flexible/cloudstorage/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - flexible-cloudstorage - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - com.google.cloud - google-cloud-storage - 0.9.4-beta - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/cloudstorage/src/main/appengine/app.yaml b/flexible/cloudstorage/src/main/appengine/app.yaml deleted file mode 100644 index da52dfa3ff2..00000000000 --- a/flexible/cloudstorage/src/main/appengine/app.yaml +++ /dev/null @@ -1,11 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - BUCKET_NAME: YOUR-BUCKET-NAME -# [END env_variables] diff --git a/flexible/cron/README.md b/flexible/cron/README.md deleted file mode 100644 index 3535287907f..00000000000 --- a/flexible/cron/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# App Engine Cron Service sample for Google App Engine -This sample demonstrates how to deploy App Engine Cron Service to ping a servlet deployed in the app. - -## Running locally - $ mvn jetty:run - -## Deploying app - $ mvn gcloud:deploy - -## Deploying cron job - $ gcloud app deploy cron.yaml \ No newline at end of file diff --git a/flexible/cron/pom.xml b/flexible/cron/pom.xml deleted file mode 100644 index ff1ced1f34b..00000000000 --- a/flexible/cron/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.managedvms - managed-vms-cron - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/cron/src/main/appengine/app.yaml b/flexible/cron/src/main/appengine/app.yaml deleted file mode 100644 index d7890aaff58..00000000000 --- a/flexible/cron/src/main/appengine/app.yaml +++ /dev/null @@ -1,6 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored diff --git a/flexible/async-rest/LICENSE b/flexible/custom/async-rest/LICENSE similarity index 100% rename from flexible/async-rest/LICENSE rename to flexible/custom/async-rest/LICENSE diff --git a/flexible/async-rest/README.md b/flexible/custom/async-rest/README.md similarity index 100% rename from flexible/async-rest/README.md rename to flexible/custom/async-rest/README.md diff --git a/flexible/async-rest/pom.xml b/flexible/custom/async-rest/pom.xml similarity index 100% rename from flexible/async-rest/pom.xml rename to flexible/custom/async-rest/pom.xml diff --git a/flexible/async-rest/src/main/appengine/app.yaml b/flexible/custom/async-rest/src/main/appengine/app.yaml similarity index 100% rename from flexible/async-rest/src/main/appengine/app.yaml rename to flexible/custom/async-rest/src/main/appengine/app.yaml diff --git a/flexible/async-rest/src/main/docker/Dockerfile b/flexible/custom/async-rest/src/main/docker/Dockerfile similarity index 100% rename from flexible/async-rest/src/main/docker/Dockerfile rename to flexible/custom/async-rest/src/main/docker/Dockerfile diff --git a/flexible/async-rest/src/main/docker/jetty-logging.properties b/flexible/custom/async-rest/src/main/docker/jetty-logging.properties similarity index 100% rename from flexible/async-rest/src/main/docker/jetty-logging.properties rename to flexible/custom/async-rest/src/main/docker/jetty-logging.properties diff --git a/flexible/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java b/flexible/custom/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java similarity index 100% rename from flexible/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java rename to flexible/custom/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java diff --git a/flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java b/flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java similarity index 100% rename from flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java rename to flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AbstractRestServlet.java diff --git a/flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java b/flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java similarity index 100% rename from flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java rename to flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/AsyncRestServlet.java diff --git a/flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java b/flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java similarity index 100% rename from flexible/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java rename to flexible/custom/async-rest/src/main/java/com/google/appengine/demos/asyncrest/SerialRestServlet.java diff --git a/flexible/async-rest/src/main/webapp/WEB-INF/jetty-web.xml b/flexible/custom/async-rest/src/main/webapp/WEB-INF/jetty-web.xml similarity index 100% rename from flexible/async-rest/src/main/webapp/WEB-INF/jetty-web.xml rename to flexible/custom/async-rest/src/main/webapp/WEB-INF/jetty-web.xml diff --git a/flexible/async-rest/src/main/webapp/WEB-INF/web.xml b/flexible/custom/async-rest/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from flexible/async-rest/src/main/webapp/WEB-INF/web.xml rename to flexible/custom/async-rest/src/main/webapp/WEB-INF/web.xml diff --git a/flexible/async-rest/src/main/webapp/asyncrest/green.png b/flexible/custom/async-rest/src/main/webapp/asyncrest/green.png similarity index 100% rename from flexible/async-rest/src/main/webapp/asyncrest/green.png rename to flexible/custom/async-rest/src/main/webapp/asyncrest/green.png diff --git a/flexible/async-rest/src/main/webapp/asyncrest/red.png b/flexible/custom/async-rest/src/main/webapp/asyncrest/red.png similarity index 100% rename from flexible/async-rest/src/main/webapp/asyncrest/red.png rename to flexible/custom/async-rest/src/main/webapp/asyncrest/red.png diff --git a/flexible/async-rest/src/main/webapp/index.html b/flexible/custom/async-rest/src/main/webapp/index.html similarity index 100% rename from flexible/async-rest/src/main/webapp/index.html rename to flexible/custom/async-rest/src/main/webapp/index.html diff --git a/flexible/endpoints/README.md b/flexible/custom/endpoints/README.md similarity index 100% rename from flexible/endpoints/README.md rename to flexible/custom/endpoints/README.md diff --git a/flexible/endpoints/pom.xml b/flexible/custom/endpoints/pom.xml similarity index 100% rename from flexible/endpoints/pom.xml rename to flexible/custom/endpoints/pom.xml diff --git a/flexible/endpoints/src/main/appengine/Dockerfile b/flexible/custom/endpoints/src/main/appengine/Dockerfile similarity index 100% rename from flexible/endpoints/src/main/appengine/Dockerfile rename to flexible/custom/endpoints/src/main/appengine/Dockerfile diff --git a/flexible/endpoints/src/main/appengine/app.yaml b/flexible/custom/endpoints/src/main/appengine/app.yaml similarity index 100% rename from flexible/endpoints/src/main/appengine/app.yaml rename to flexible/custom/endpoints/src/main/appengine/app.yaml diff --git a/flexible/endpoints/src/main/appengine/openapi.yaml b/flexible/custom/endpoints/src/main/appengine/openapi.yaml similarity index 100% rename from flexible/endpoints/src/main/appengine/openapi.yaml rename to flexible/custom/endpoints/src/main/appengine/openapi.yaml diff --git a/flexible/endpoints/src/main/java/com/example/endpoints/AuthInfoServlet.java b/flexible/custom/endpoints/src/main/java/com/example/endpoints/AuthInfoServlet.java similarity index 100% rename from flexible/endpoints/src/main/java/com/example/endpoints/AuthInfoServlet.java rename to flexible/custom/endpoints/src/main/java/com/example/endpoints/AuthInfoServlet.java diff --git a/flexible/endpoints/src/main/java/com/example/endpoints/EchoServlet.java b/flexible/custom/endpoints/src/main/java/com/example/endpoints/EchoServlet.java similarity index 100% rename from flexible/endpoints/src/main/java/com/example/endpoints/EchoServlet.java rename to flexible/custom/endpoints/src/main/java/com/example/endpoints/EchoServlet.java diff --git a/flexible/extending-runtime/README.md b/flexible/custom/extending-runtime/README.md similarity index 100% rename from flexible/extending-runtime/README.md rename to flexible/custom/extending-runtime/README.md diff --git a/flexible/extending-runtime/pom.xml b/flexible/custom/extending-runtime/pom.xml similarity index 100% rename from flexible/extending-runtime/pom.xml rename to flexible/custom/extending-runtime/pom.xml diff --git a/flexible/extending-runtime/src/main/appengine/Dockerfile b/flexible/custom/extending-runtime/src/main/appengine/Dockerfile similarity index 100% rename from flexible/extending-runtime/src/main/appengine/Dockerfile rename to flexible/custom/extending-runtime/src/main/appengine/Dockerfile diff --git a/flexible/extending-runtime/src/main/appengine/app.yaml b/flexible/custom/extending-runtime/src/main/appengine/app.yaml similarity index 100% rename from flexible/extending-runtime/src/main/appengine/app.yaml rename to flexible/custom/extending-runtime/src/main/appengine/app.yaml diff --git a/flexible/extending-runtime/src/main/java/com/example/extendingruntime/FortuneServlet.java b/flexible/custom/extending-runtime/src/main/java/com/example/extendingruntime/FortuneServlet.java similarity index 100% rename from flexible/extending-runtime/src/main/java/com/example/extendingruntime/FortuneServlet.java rename to flexible/custom/extending-runtime/src/main/java/com/example/extendingruntime/FortuneServlet.java diff --git a/flexible/sparkjava/README.md b/flexible/custom/sparkjava/README.md similarity index 100% rename from flexible/sparkjava/README.md rename to flexible/custom/sparkjava/README.md diff --git a/flexible/sparkjava/jenkins.sh b/flexible/custom/sparkjava/jenkins.sh similarity index 100% rename from flexible/sparkjava/jenkins.sh rename to flexible/custom/sparkjava/jenkins.sh diff --git a/flexible/sparkjava/pom.xml b/flexible/custom/sparkjava/pom.xml similarity index 100% rename from flexible/sparkjava/pom.xml rename to flexible/custom/sparkjava/pom.xml diff --git a/flexible/sparkjava/src/main/appengine/app.yaml b/flexible/custom/sparkjava/src/main/appengine/app.yaml similarity index 100% rename from flexible/sparkjava/src/main/appengine/app.yaml rename to flexible/custom/sparkjava/src/main/appengine/app.yaml diff --git a/flexible/sparkjava/src/main/docker/Dockerfile b/flexible/custom/sparkjava/src/main/docker/Dockerfile similarity index 100% rename from flexible/sparkjava/src/main/docker/Dockerfile rename to flexible/custom/sparkjava/src/main/docker/Dockerfile diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/Main.java b/flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/Main.java similarity index 100% rename from flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/Main.java rename to flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/Main.java diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/ResponseError.java b/flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/ResponseError.java similarity index 100% rename from flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/ResponseError.java rename to flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/ResponseError.java diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/User.java b/flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/User.java similarity index 100% rename from flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/User.java rename to flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/User.java diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java b/flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java similarity index 100% rename from flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java rename to flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java b/flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java similarity index 100% rename from flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java rename to flexible/custom/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java diff --git a/flexible/sparkjava/src/main/resources/public/index.html b/flexible/custom/sparkjava/src/main/resources/public/index.html similarity index 100% rename from flexible/sparkjava/src/main/resources/public/index.html rename to flexible/custom/sparkjava/src/main/resources/public/index.html diff --git a/flexible/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserControllerTest.java b/flexible/custom/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserControllerTest.java similarity index 100% rename from flexible/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserControllerTest.java rename to flexible/custom/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserControllerTest.java diff --git a/flexible/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserServiceTest.java b/flexible/custom/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserServiceTest.java similarity index 100% rename from flexible/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserServiceTest.java rename to flexible/custom/sparkjava/src/test/java/com/google/appengine/sparkdemo/UserServiceTest.java diff --git a/flexible/datastore/pom.xml b/flexible/datastore/pom.xml deleted file mode 100644 index 31aacc38686..00000000000 --- a/flexible/datastore/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - flexible-datastore - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - com.google.cloud - google-cloud-datastore - 0.9.4-beta - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/datastore/src/main/appengine/app.yaml b/flexible/datastore/src/main/appengine/app.yaml deleted file mode 100644 index c84d3698432..00000000000 --- a/flexible/datastore/src/main/appengine/app.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2016 Google Inc. All Rights Reserved. -# -# 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 -# -# 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. -# - -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored diff --git a/flexible/disk/pom.xml b/flexible/disk/pom.xml deleted file mode 100644 index 163c5969ee9..00000000000 --- a/flexible/disk/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - flexible-disk - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/disk/src/main/appengine/app.yaml b/flexible/disk/src/main/appengine/app.yaml deleted file mode 100644 index d7890aaff58..00000000000 --- a/flexible/disk/src/main/appengine/app.yaml +++ /dev/null @@ -1,6 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored diff --git a/flexible/helloworld/README.md b/flexible/java/helloworld/README.md similarity index 100% rename from flexible/helloworld/README.md rename to flexible/java/helloworld/README.md diff --git a/flexible/helloworld/build.gradle b/flexible/java/helloworld/build.gradle similarity index 100% rename from flexible/helloworld/build.gradle rename to flexible/java/helloworld/build.gradle diff --git a/flexible/helloworld/gradle/wrapper/gradle-wrapper.properties b/flexible/java/helloworld/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from flexible/helloworld/gradle/wrapper/gradle-wrapper.properties rename to flexible/java/helloworld/gradle/wrapper/gradle-wrapper.properties diff --git a/flexible/helloworld/gradlew b/flexible/java/helloworld/gradlew similarity index 100% rename from flexible/helloworld/gradlew rename to flexible/java/helloworld/gradlew diff --git a/flexible/helloworld/gradlew.bat b/flexible/java/helloworld/gradlew.bat similarity index 100% rename from flexible/helloworld/gradlew.bat rename to flexible/java/helloworld/gradlew.bat diff --git a/flexible/helloworld/pom.xml b/flexible/java/helloworld/pom.xml similarity index 100% rename from flexible/helloworld/pom.xml rename to flexible/java/helloworld/pom.xml diff --git a/flexible/helloworld/src/main/appengine/app.yaml b/flexible/java/helloworld/src/main/appengine/app.yaml similarity index 100% rename from flexible/helloworld/src/main/appengine/app.yaml rename to flexible/java/helloworld/src/main/appengine/app.yaml diff --git a/flexible/helloworld/src/main/java/com/example/flexible/helloworld/HelloServlet.java b/flexible/java/helloworld/src/main/java/com/example/flexible/helloworld/HelloServlet.java similarity index 100% rename from flexible/helloworld/src/main/java/com/example/flexible/helloworld/HelloServlet.java rename to flexible/java/helloworld/src/main/java/com/example/flexible/helloworld/HelloServlet.java diff --git a/flexible/cloudstorage/README.md b/flexible/java/samples/README.md similarity index 100% rename from flexible/cloudstorage/README.md rename to flexible/java/samples/README.md diff --git a/flexible/mailgun/pom.xml b/flexible/java/samples/pom.xml similarity index 70% rename from flexible/mailgun/pom.xml rename to flexible/java/samples/pom.xml index 84e6b51265c..fe4afb3c306 100644 --- a/flexible/mailgun/pom.xml +++ b/flexible/java/samples/pom.xml @@ -18,7 +18,7 @@ war 1.0-SNAPSHOT com.example.flexible - mailgun + flexible-samples doc-samples @@ -38,6 +38,11 @@ + + org.apache.httpcomponents + httpclient + 4.5.3 + javax.servlet javax.servlet-api @@ -45,7 +50,37 @@ jar provided + + com.googlecode.xmemcached + xmemcached + 2.3.0 + + + com.sendgrid + sendgrid-java + 2.2.2 + + + com.twilio.sdk + twilio-java-sdk + 6.3.0 + + + com.google.cloud + google-cloud-storage + 0.9.4-beta + + + com.google.cloud + google-cloud-datastore + 0.9.4-beta + + + com.mailjet + mailjet-client + 4.0.5 + com.sun.jersey jersey-core @@ -63,7 +98,6 @@ - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes diff --git a/flexible/java/samples/src/main/appengine/app.yaml b/flexible/java/samples/src/main/appengine/app.yaml new file mode 100644 index 00000000000..9c3d37396cb --- /dev/null +++ b/flexible/java/samples/src/main/appengine/app.yaml @@ -0,0 +1,31 @@ +runtime: java +env: flex + +handlers: +- url: /.* + script: this field is required, but ignored + +use_memcache_proxy: true + +# [START env_variables] +env_variables: + # [START sendgrid] + SENDGRID_API_KEY: YOUR-SENDGRID-API-KEY + SENDGRID_SENDER: YOUR-SENDGRID-SENDER + # [END sendgrid] + + # [START twilio] + TWILIO_ACCOUNT_SID: YOUR-TWILIO-ACCOUNT-SID + TWILIO_AUTH_TOKEN: YOUR-TWILIO-AUTH-TOKEN + TWILIO_NUMBER: YOUR-TWILIO-NUMBER + # [END twilio] + + # [START analytics] + GA_TRACKING_ID: YOUR-GA-TRACKING-ID + # [END analytics] + + # [START upload] + BUCKET_NAME: YOUR-BUCKET-NAME + #[END upload] + +# [END env_variables] diff --git a/flexible/cron/src/main/appengine/cron.yaml b/flexible/java/samples/src/main/appengine/cron.yaml similarity index 100% rename from flexible/cron/src/main/appengine/cron.yaml rename to flexible/java/samples/src/main/appengine/cron.yaml diff --git a/flexible/java/samples/src/main/java/com/example/flexible/SamplesIndex.java b/flexible/java/samples/src/main/java/com/example/flexible/SamplesIndex.java new file mode 100644 index 00000000000..ae694e49098 --- /dev/null +++ b/flexible/java/samples/src/main/java/com/example/flexible/SamplesIndex.java @@ -0,0 +1,42 @@ +package com.example.flexible; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.servlet.ServletRegistration; +import javax.servlet.http.HttpServletRequest; + +public class SamplesIndex { + + private static Set ignorePatterns = new HashSet<>(); + + static { + ignorePatterns.addAll(Arrays.asList("jsp", "default", "cron")); + } + + public static List getSamples(HttpServletRequest request) { + List samplesList = new ArrayList<>(); + StringBuilder sb = new StringBuilder(); + Map servletRegistrations = + request.getServletContext().getServletRegistrations(); + for (Map.Entry registrationEntry : + servletRegistrations.entrySet()) { + if (!ignorePatterns.contains(registrationEntry.getKey())) { + for (String mapping : registrationEntry.getValue().getMappings()) { + sb.append(""); + sb.append(registrationEntry.getKey()); + sb.append(""); + samplesList.add(sb.toString()); + sb.setLength(0); + } + } + } + return samplesList; + } +} \ No newline at end of file diff --git a/flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/analytics/AnalyticsServlet.java similarity index 95% rename from flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/analytics/AnalyticsServlet.java index d451a799629..3ebf8a553ef 100644 --- a/flexible/analytics/src/main/java/com/example/analytics/AnalyticsServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/analytics/AnalyticsServlet.java @@ -14,26 +14,24 @@ * limitations under the License. */ -package com.example.analytics; - -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.impl.client.HttpClientBuilder; +package com.example.flexible.analytics; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; - 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.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.HttpClientBuilder; // [START example] @SuppressWarnings("serial") -@WebServlet(name = "analytics", value = "") +@WebServlet(name = "Add Google Analytics event", value = "/analytics") public class AnalyticsServlet extends HttpServlet { @Override diff --git a/flexible/cloudsql/src/main/java/com/example/cloudsql/CloudSqlServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/cloudsql/CloudSqlServlet.java similarity index 97% rename from flexible/cloudsql/src/main/java/com/example/cloudsql/CloudSqlServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/cloudsql/CloudSqlServlet.java index 45558bb24f8..b03ad85e86e 100644 --- a/flexible/cloudsql/src/main/java/com/example/cloudsql/CloudSqlServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/cloudsql/CloudSqlServlet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.cloudsql; +package com.example.flexible.cloudsql; import java.io.IOException; import java.io.PrintWriter; @@ -29,7 +29,6 @@ import java.sql.Timestamp; import java.util.Date; import java.util.Properties; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -38,7 +37,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "cloudsql", value = "") +@WebServlet(name = "CloudSQL Sample", value = "/cloudsql") public class CloudSqlServlet extends HttpServlet { String url; diff --git a/flexible/cron/src/main/java/com/example/cron/CronServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/cron/CronServlet.java similarity index 97% rename from flexible/cron/src/main/java/com/example/cron/CronServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/cron/CronServlet.java index 998e013b2e2..83e003282e9 100644 --- a/flexible/cron/src/main/java/com/example/cron/CronServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/cron/CronServlet.java @@ -14,11 +14,10 @@ * limitations under the License. */ -package com.example.cron; +package com.example.flexible.cron; import java.io.IOException; import java.io.PrintWriter; - import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/flexible/datastore/src/main/java/com/example/datastore/DatastoreServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/datastore/DatastoreServlet.java similarity index 97% rename from flexible/datastore/src/main/java/com/example/datastore/DatastoreServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/datastore/DatastoreServlet.java index ef9822cd1f8..d8cc888b002 100644 --- a/flexible/datastore/src/main/java/com/example/datastore/DatastoreServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/datastore/DatastoreServlet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.managedvms.datastore; +package com.example.flexible.datastore; import com.google.cloud.datastore.Datastore; import com.google.cloud.datastore.DatastoreOptions; @@ -26,13 +26,11 @@ import com.google.cloud.datastore.Query; import com.google.cloud.datastore.QueryResults; import com.google.cloud.datastore.StructuredQuery; - import java.io.IOException; import java.io.PrintWriter; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -41,7 +39,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "datastore", value = "") +@WebServlet(name = "Datastore Sample", value = "/datastore") public class DatastoreServlet extends HttpServlet { @Override diff --git a/flexible/disk/src/main/java/com/example/disk/DiskServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/disk/DiskServlet.java similarity index 96% rename from flexible/disk/src/main/java/com/example/disk/DiskServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/disk/DiskServlet.java index 24c0e5b027a..63b3c31631d 100644 --- a/flexible/disk/src/main/java/com/example/disk/DiskServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/disk/DiskServlet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.disk; +package com.example.flexible.disk; import java.io.IOException; import java.io.PrintWriter; @@ -27,7 +27,6 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.List; - import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -35,7 +34,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "disk", value = "") +@WebServlet(name = "Read/Write to disk", value = "/disk") public class DiskServlet extends HttpServlet { @Override diff --git a/flexible/mailgun/src/main/java/com/example/mailgun/MailgunServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/mailgun/MailgunServlet.java similarity index 99% rename from flexible/mailgun/src/main/java/com/example/mailgun/MailgunServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/mailgun/MailgunServlet.java index 304cd05f917..e06781c3350 100644 --- a/flexible/mailgun/src/main/java/com/example/mailgun/MailgunServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/mailgun/MailgunServlet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.mailgun; +package com.example.flexible.mailgun; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; @@ -23,10 +23,8 @@ import com.sun.jersey.core.util.MultivaluedMapImpl; import com.sun.jersey.multipart.FormDataMultiPart; import com.sun.jersey.multipart.file.FileDataBodyPart; - import java.io.File; import java.io.IOException; - import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/flexible/mailjet/src/main/java/com/example/mailjet/MailjetServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/mailjet/MailjetServlet.java similarity index 96% rename from flexible/mailjet/src/main/java/com/example/mailjet/MailjetServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/mailjet/MailjetServlet.java index b8723834431..af2e5d1f139 100644 --- a/flexible/mailjet/src/main/java/com/example/mailjet/MailjetServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/mailjet/MailjetServlet.java @@ -15,7 +15,7 @@ */ // [START mailjet_imports] -package com.example.mailjet; +package com.example.flexible.mailjet; import com.mailjet.client.MailjetClient; import com.mailjet.client.MailjetRequest; @@ -38,7 +38,7 @@ // [START app] @SuppressWarnings("serial") -@WebServlet(name = "mailjet", value = "/send/email") +@WebServlet(name = "Send an email using MailJet", value = "/mailjet/send/email") public class MailjetServlet extends HttpServlet { private static final String MAILJET_API_KEY = System.getenv("MAILJET_API_KEY"); private static final String MAILJET_SECRET_KEY = System.getenv("MAILJET_SECRET_KEY"); diff --git a/flexible/memcache/src/main/java/com/example/memcache/MemcacheServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/memcache/MemcacheServlet.java similarity index 95% rename from flexible/memcache/src/main/java/com/example/memcache/MemcacheServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/memcache/MemcacheServlet.java index ad46b2437bd..163d3eb6ac3 100644 --- a/flexible/memcache/src/main/java/com/example/memcache/MemcacheServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/memcache/MemcacheServlet.java @@ -14,26 +14,24 @@ * limitations under the License. */ -package com.example.memcache; - -import net.rubyeye.xmemcached.MemcachedClient; -import net.rubyeye.xmemcached.MemcachedClientBuilder; -import net.rubyeye.xmemcached.XMemcachedClientBuilder; -import net.rubyeye.xmemcached.exception.MemcachedException; -import net.rubyeye.xmemcached.utils.AddrUtil; +package com.example.flexible.memcache; import java.io.IOException; import java.util.concurrent.TimeoutException; - 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 net.rubyeye.xmemcached.MemcachedClient; +import net.rubyeye.xmemcached.MemcachedClientBuilder; +import net.rubyeye.xmemcached.XMemcachedClientBuilder; +import net.rubyeye.xmemcached.exception.MemcachedException; +import net.rubyeye.xmemcached.utils.AddrUtil; // [START example] @SuppressWarnings("serial") -@WebServlet(name = "memcache", value = "") +@WebServlet(name = "Memcache sample", value = "/memcache") public class MemcacheServlet extends HttpServlet { @Override diff --git a/flexible/sendgrid/src/main/java/com/example/sendgrid/SendEmailServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/sendgrid/SendEmailServlet.java similarity index 94% rename from flexible/sendgrid/src/main/java/com/example/sendgrid/SendEmailServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/sendgrid/SendEmailServlet.java index cfbd0232d04..8ac7c480e23 100644 --- a/flexible/sendgrid/src/main/java/com/example/sendgrid/SendEmailServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/sendgrid/SendEmailServlet.java @@ -14,13 +14,11 @@ * limitations under the License. */ -package com.example.sendgrid; +package com.example.flexible.sendgrid; import com.sendgrid.SendGrid; import com.sendgrid.SendGridException; - import java.io.IOException; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -29,7 +27,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "sendemail", value = "/send/email") +@WebServlet(name = "Send an email using SendGrid", value = "/sendgrid/email/send") public class SendEmailServlet extends HttpServlet { @Override diff --git a/flexible/twilio/src/main/java/com/example/twilio/ReceiveCallServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveCallServlet.java similarity index 93% rename from flexible/twilio/src/main/java/com/example/twilio/ReceiveCallServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveCallServlet.java index 9fb115f9ab1..a40c0b03ddc 100644 --- a/flexible/twilio/src/main/java/com/example/twilio/ReceiveCallServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveCallServlet.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package com.example.twilio; +package com.example.flexible.twilio; import com.twilio.sdk.verbs.Say; import com.twilio.sdk.verbs.TwiMLException; import com.twilio.sdk.verbs.TwiMLResponse; - import java.io.IOException; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -30,7 +28,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "receivecall", value = "/call/receive") +@WebServlet(name = "Receive a call", value = "/twillio/call/receive") public class ReceiveCallServlet extends HttpServlet { @Override diff --git a/flexible/twilio/src/main/java/com/example/twilio/ReceiveSmsServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveSmsServlet.java similarity index 94% rename from flexible/twilio/src/main/java/com/example/twilio/ReceiveSmsServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveSmsServlet.java index 5a47ea3b303..5b7488617f8 100644 --- a/flexible/twilio/src/main/java/com/example/twilio/ReceiveSmsServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/twilio/ReceiveSmsServlet.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package com.example.twilio; +package com.example.flexible.twilio; import com.twilio.sdk.verbs.Message; import com.twilio.sdk.verbs.TwiMLException; import com.twilio.sdk.verbs.TwiMLResponse; - import java.io.IOException; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; @@ -30,7 +28,7 @@ // [START example] @SuppressWarnings("serial") -@WebServlet(name = "receivesms", value = "/sms/receive") +@WebServlet(name = "Receive an SMS", value = "/twillio/sms/receive") public class ReceiveSmsServlet extends HttpServlet { @Override diff --git a/flexible/twilio/src/main/java/com/example/twilio/SendSmsServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/twilio/SendSmsServlet.java similarity index 96% rename from flexible/twilio/src/main/java/com/example/twilio/SendSmsServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/twilio/SendSmsServlet.java index ae0af6c6564..a7fab3c907c 100644 --- a/flexible/twilio/src/main/java/com/example/twilio/SendSmsServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/twilio/SendSmsServlet.java @@ -14,29 +14,27 @@ * limitations under the License. */ -package com.example.twilio; +package com.example.flexible.twilio; import com.twilio.sdk.TwilioRestClient; import com.twilio.sdk.TwilioRestException; import com.twilio.sdk.resource.factory.MessageFactory; import com.twilio.sdk.resource.instance.Account; import com.twilio.sdk.resource.instance.Message; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; - import java.io.IOException; import java.util.ArrayList; import java.util.List; - 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.NameValuePair; +import org.apache.http.message.BasicNameValuePair; // [START example] @SuppressWarnings("serial") -@WebServlet(name = "sendsms", value = "/sms/send") +@WebServlet(name = "Send an SMS", value = "/twillio/sms/send") public class SendSmsServlet extends HttpServlet { @Override diff --git a/flexible/cloudstorage/src/main/java/com/example/cloudstorage/UploadServlet.java b/flexible/java/samples/src/main/java/com/example/flexible/upload/UploadServlet.java similarity index 94% rename from flexible/cloudstorage/src/main/java/com/example/cloudstorage/UploadServlet.java rename to flexible/java/samples/src/main/java/com/example/flexible/upload/UploadServlet.java index 6223073be4e..947b965fae3 100644 --- a/flexible/cloudstorage/src/main/java/com/example/cloudstorage/UploadServlet.java +++ b/flexible/java/samples/src/main/java/com/example/flexible/upload/UploadServlet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.cloudstorage; +package com.example.flexible.upload; import com.google.cloud.storage.Acl; import com.google.cloud.storage.Blob; @@ -34,9 +34,9 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Part; -// [START example] +// [START upload] @SuppressWarnings("serial") -@WebServlet(name = "upload", value = "/upload") +@WebServlet(name = "Upload a file to a GCS bucket", value = "/upload") @MultipartConfig() public class UploadServlet extends HttpServlet { @@ -67,4 +67,4 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx resp.getWriter().print(blob.getMediaLink()); } } -// [END example] +// [END upload] diff --git a/flexible/cloudsql/src/main/resources/config.properties b/flexible/java/samples/src/main/resources/config.properties similarity index 100% rename from flexible/cloudsql/src/main/resources/config.properties rename to flexible/java/samples/src/main/resources/config.properties diff --git a/flexible/mailgun/src/main/resources/example-attachment.txt b/flexible/java/samples/src/main/resources/example-attachment.txt similarity index 100% rename from flexible/mailgun/src/main/resources/example-attachment.txt rename to flexible/java/samples/src/main/resources/example-attachment.txt diff --git a/flexible/java/samples/src/main/webapp/analytics.html b/flexible/java/samples/src/main/webapp/analytics.html new file mode 100644 index 00000000000..7d77c8bb4b0 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/analytics.html @@ -0,0 +1,10 @@ + +Google Analytics Tracking Sample + +

Add Google analytics tracking to a GAE Flex App

+ +
+ +
+ + diff --git a/flexible/java/samples/src/main/webapp/cloudsql.html b/flexible/java/samples/src/main/webapp/cloudsql.html new file mode 100644 index 00000000000..9ae8d67d131 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/cloudsql.html @@ -0,0 +1,9 @@ + +Google Cloud SQL Sample + +
+

Track user visit in Cloud SQL + +

+ + diff --git a/flexible/java/samples/src/main/webapp/datastore.html b/flexible/java/samples/src/main/webapp/datastore.html new file mode 100644 index 00000000000..c764800cd8a --- /dev/null +++ b/flexible/java/samples/src/main/webapp/datastore.html @@ -0,0 +1,9 @@ + +Google Cloud SQL Sample + +
+

Track user visit in Cloud Datastore + +

+ + diff --git a/flexible/java/samples/src/main/webapp/disk.html b/flexible/java/samples/src/main/webapp/disk.html new file mode 100644 index 00000000000..b9ae074ebb7 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/disk.html @@ -0,0 +1,9 @@ + +Disk Sample + +
+

Track user ip on disk + +

+ + \ No newline at end of file diff --git a/flexible/java/samples/src/main/webapp/index.jsp b/flexible/java/samples/src/main/webapp/index.jsp new file mode 100644 index 00000000000..a88b2df760d --- /dev/null +++ b/flexible/java/samples/src/main/webapp/index.jsp @@ -0,0 +1,19 @@ +<%@ page import="com.example.flexible.SamplesIndex" %> + + + GAE Flex Samples + + +
    + <% + for (String sample : SamplesIndex.getSamples(request)) { + %> +
  • <%= sample %> +
  • + <% + } + %> +
  • A static HTML page
  • +
+ + \ No newline at end of file diff --git a/flexible/mailgun/src/main/webapp/index.html b/flexible/java/samples/src/main/webapp/mailgun/email/send.html similarity index 87% rename from flexible/mailgun/src/main/webapp/index.html rename to flexible/java/samples/src/main/webapp/mailgun/email/send.html index 96d9a88b936..804030b7955 100644 --- a/flexible/mailgun/src/main/webapp/index.html +++ b/flexible/java/samples/src/main/webapp/mailgun/email/send.html @@ -5,7 +5,7 @@ -
+ diff --git a/flexible/java/samples/src/main/webapp/mailjet/email/send.html b/flexible/java/samples/src/main/webapp/mailjet/email/send.html new file mode 100644 index 00000000000..74047f70724 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/mailjet/email/send.html @@ -0,0 +1,14 @@ + + + Mailgun on Google App Engine Flexible + + + + + + + +
+ + + diff --git a/flexible/java/samples/src/main/webapp/memcache.html b/flexible/java/samples/src/main/webapp/memcache.html new file mode 100644 index 00000000000..973c7ca5750 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/memcache.html @@ -0,0 +1,12 @@ + + + + + Memcache test + + +
+ +
+ + \ No newline at end of file diff --git a/flexible/java/samples/src/main/webapp/sendgrid/email/send.html b/flexible/java/samples/src/main/webapp/sendgrid/email/send.html new file mode 100644 index 00000000000..13a563c6ff6 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/sendgrid/email/send.html @@ -0,0 +1,10 @@ + +Send an email using SendGrid + +
+

Enter an email address :

+ + +
+ + \ No newline at end of file diff --git a/flexible/static-files/src/main/webapp/index.html b/flexible/java/samples/src/main/webapp/static.html similarity index 100% rename from flexible/static-files/src/main/webapp/index.html rename to flexible/java/samples/src/main/webapp/static.html diff --git a/flexible/static-files/src/main/webapp/stylesheets/styles.css b/flexible/java/samples/src/main/webapp/stylesheets/styles.css similarity index 100% rename from flexible/static-files/src/main/webapp/stylesheets/styles.css rename to flexible/java/samples/src/main/webapp/stylesheets/styles.css diff --git a/flexible/java/samples/src/main/webapp/twillio/call/receive.html b/flexible/java/samples/src/main/webapp/twillio/call/receive.html new file mode 100644 index 00000000000..f1b793dc771 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/twillio/call/receive.html @@ -0,0 +1,8 @@ + +Twilio Code Samples + +
+ +
+ + \ No newline at end of file diff --git a/flexible/java/samples/src/main/webapp/twillio/sms/receive.html b/flexible/java/samples/src/main/webapp/twillio/sms/receive.html new file mode 100644 index 00000000000..b5c825e0d56 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/twillio/sms/receive.html @@ -0,0 +1,8 @@ + +Twilio Code Samples + +
+ +
+ + \ No newline at end of file diff --git a/flexible/java/samples/src/main/webapp/twillio/sms/send.html b/flexible/java/samples/src/main/webapp/twillio/sms/send.html new file mode 100644 index 00000000000..b33ac23a0d8 --- /dev/null +++ b/flexible/java/samples/src/main/webapp/twillio/sms/send.html @@ -0,0 +1,9 @@ + +Twilio Code Samples + +
+

Enter a name : +

+

+ + \ No newline at end of file diff --git a/flexible/cloudstorage/src/main/webapp/index.html b/flexible/java/samples/src/main/webapp/upload.html similarity index 81% rename from flexible/cloudstorage/src/main/webapp/index.html rename to flexible/java/samples/src/main/webapp/upload.html index 78e9c675a9b..0c8c12df7e3 100644 --- a/flexible/cloudstorage/src/main/webapp/index.html +++ b/flexible/java/samples/src/main/webapp/upload.html @@ -1,5 +1,5 @@ - Google Managed VMs Cloud Storage Sample + Cloud Storage Sample

Select a file to upload to your Google Cloud Storage bucket.

diff --git a/flexible/mailgun/README.md b/flexible/mailgun/README.md deleted file mode 100644 index cbd6b6d3460..00000000000 --- a/flexible/mailgun/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Java Mailgun email sample for Google App Engine Managed VMs -This sample demonstrates how to use [Mailgun](https://www.mailgun.com) on [Google App Engine Managed VMs](https://cloud.google.com/appengine). -For more information about Mailgun, see their [documentation](https://documentation.mailgun.com/). - -## Setup -Before you can run or deploy the sample, you will need to do the following: -1. [Create a Mailgun Account](http://www.mailgun.com/google). As of September 2015, Google users start with 30,000 free emails per month. -2. Configure your Mailgun settings in the environment variables section in ``app.yaml``. - -## Running locally -Refer to the [top-level README](../README.md) for instructions on running and deploying. -You can run the application locally and send emails from your local machine. You -will need to set environment variables before starting your application: - $ export MAILGUN_API_KEY=[your-mailgun-api-key] - $ export MAILGUN_DOMAIN_NAME=[your-mailgun-domain-name] - $ mvn clean jetty:run - -## Deployment -update values above in your `src/main/appengine/app.yaml` - - $ mvn clean appengine:deploy diff --git a/flexible/mailgun/src/main/appengine/app.yaml b/flexible/mailgun/src/main/appengine/app.yaml deleted file mode 100644 index 542b11b162f..00000000000 --- a/flexible/mailgun/src/main/appengine/app.yaml +++ /dev/null @@ -1,12 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - MAILGUN_DOMAIN_NAME: YOUR-MAILGUN-DOMAIN-NAME - MAILGUN_API_KEY: YOUR-MAILGUN-API-KEY -# [END env_variables] diff --git a/flexible/mailjet/README.md b/flexible/mailjet/README.md deleted file mode 100644 index 0f51f24cf69..00000000000 --- a/flexible/mailjet/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Mailjet sample for Google Managed VMs -This sample demonstrates how to use [Mailjet](https://www.mailjet.com/) on Google Managed VMs to -send emails from a verified sender you own. - -## Setup -1. Before using, ensure the address you plan to send from has been verified in Mailjet. - -## Running locally - $ export MAILJET_API_KEY=[your mailjet api key] - $ export MAILJET_SECRET_KEY=[your mailjet secret key] - $ mvn clean jetty:run - -## Deploying -1. Edit the environment variables in the app.yaml with the appropriate Mailjet values. - $ mvn clean appengine:deploy diff --git a/flexible/mailjet/pom.xml b/flexible/mailjet/pom.xml deleted file mode 100644 index 68bc3da161d..00000000000 --- a/flexible/mailjet/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - mailjet - - - com.google.cloud - doc-samples - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - 4.0.5 - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - com.mailjet - mailjet-client - ${mailjet-version} - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/mailjet/src/main/appengine/app.yaml b/flexible/mailjet/src/main/appengine/app.yaml deleted file mode 100644 index a41ea04614a..00000000000 --- a/flexible/mailjet/src/main/appengine/app.yaml +++ /dev/null @@ -1,12 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - MAILJET_API_KEY: YOUR-MAILJET-API-KEY - MAILJET_SECRET_KEY: YOUR-MAILJET-SECRET-KEY -# [END env_variables] diff --git a/flexible/mailjet/src/main/webapp/WEB-INF/lib/client-3.1.1-jar-with-dependencies.jar b/flexible/mailjet/src/main/webapp/WEB-INF/lib/client-3.1.1-jar-with-dependencies.jar deleted file mode 100644 index e3b58094cf6..00000000000 Binary files a/flexible/mailjet/src/main/webapp/WEB-INF/lib/client-3.1.1-jar-with-dependencies.jar and /dev/null differ diff --git a/flexible/mailjet/src/main/webapp/index.html b/flexible/mailjet/src/main/webapp/index.html deleted file mode 100644 index 5b7cc9a3ee6..00000000000 --- a/flexible/mailjet/src/main/webapp/index.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Mailgun on Google App Engine Flexible - - - - - - - -
- - - diff --git a/flexible/memcache/README.md b/flexible/memcache/README.md deleted file mode 100644 index aab8ddf0d2e..00000000000 --- a/flexible/memcache/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# flexible/memcache - -How to use memcache on flexible. - -# NEEDS WORK - -This sample needs to be updated to use redis-memcache diff --git a/flexible/memcache/pom.xml b/flexible/memcache/pom.xml deleted file mode 100644 index 398c1765ea9..00000000000 --- a/flexible/memcache/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - memcache - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - com.googlecode.xmemcached - xmemcached - 2.3.0 - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/memcache/src/main/appengine/app.yaml b/flexible/memcache/src/main/appengine/app.yaml deleted file mode 100644 index 2bf46125d17..00000000000 --- a/flexible/memcache/src/main/appengine/app.yaml +++ /dev/null @@ -1,11 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START config] -beta_settings: - use_memcache_proxy: true -# [END config] diff --git a/flexible/sendgrid/README.md b/flexible/sendgrid/README.md deleted file mode 100644 index d7786659624..00000000000 --- a/flexible/sendgrid/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Java SendGrid Email Sample for Google App Engine Flexible Environment - -This sample demonstrates how to use [SendGrid](https://www.sendgrid.com) on -[Google App Engine flexible environment][aeflex-docs]. - -See the [sample application documentaion][sample-docs] for more detailed -instructions. - -For more information about SendGrid, see their -[documentation](https://sendgrid.com/docs/User_Guide/index.html). - -[aeflex-docs]: https://cloud.google.com/appengine/docs/flexible/ -[sample-docs]: https://cloud.google.com/appengine/docs/flexible/java/sending-emails-with-sendgrid - -## Setup - -Before you can run or deploy the sample, you will need to do the following: - -1. [Create a SendGrid Account](http://sendgrid.com/partner/google). As of - September 2015, Google users start with 25,000 free emails per month. -1. Configure your SendGrid settings in the environment variables section in - [`src/main/appengine/app.yaml`](src/main/appengine/app.yaml). - -## Running locally - -You can run the application locally and send emails from your local machine. You -will need to set environment variables before starting your application: - - $ export SENDGRID_API_KEY=[your-sendgrid-api-key] - $ export SENDGRID_SENDER=[your-sendgrid-sender-email-address] - $ mvn clean jetty:run diff --git a/flexible/sendgrid/pom.xml b/flexible/sendgrid/pom.xml deleted file mode 100644 index 926dddb88a8..00000000000 --- a/flexible/sendgrid/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.managedvms - managed-vms-sendgrid - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - com.sendgrid - sendgrid-java - 2.2.2 - - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/sendgrid/src/main/appengine/app.yaml b/flexible/sendgrid/src/main/appengine/app.yaml deleted file mode 100644 index 0efc5d7b4d2..00000000000 --- a/flexible/sendgrid/src/main/appengine/app.yaml +++ /dev/null @@ -1,12 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - SENDGRID_API_KEY: YOUR-SENDGRID-API-KEY - SENDGRID_SENDER: YOUR-SENDGRID-SENDER -# [END env_variables] diff --git a/flexible/static-files/pom.xml b/flexible/static-files/pom.xml deleted file mode 100644 index 223ccdb9b88..00000000000 --- a/flexible/static-files/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - staticfiles - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/static-files/src/main/appengine/app.yaml b/flexible/static-files/src/main/appengine/app.yaml deleted file mode 100644 index d7890aaff58..00000000000 --- a/flexible/static-files/src/main/appengine/app.yaml +++ /dev/null @@ -1,6 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored diff --git a/flexible/twilio/README.md b/flexible/twilio/README.md deleted file mode 100644 index a1234c78af6..00000000000 --- a/flexible/twilio/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Java Twilio Voice and SMS Sample for Google App Engine Flexible Environment - -This sample demonstrates how to use [Twilio](https://www.twilio.com) on [Google -App flexible environment][aeflex-docs]. - -See the [sample application documentaion][sample-docs] for more detailed -instructions. - -For more information about Twilio, see their [Java quickstart -tutorials](https://www.twilio.com/docs/quickstart/java). - -[aeflex-docs]: https://cloud.google.com/appengine/docs/flexible/ -[sample-docs]: https://cloud.google.com/appengine/docs/flexible/java/using-sms-and-voice-services-via-twilio - - -## Setup - -Before you can run or deploy the sample, you will need to do the following: - -1. [Create a Twilio Account](http://ahoy.twilio.com/googlecloudplatform). Google - App Engine customers receive a complimentary credit for SMS messages and - inbound messages. -1. Create a number on twilio, and configure the voice request URL to be - ``https://your-app-id.appspot.com/call/receive`` and the SMS request URL to - be ``https://your-app-id.appspot.com/sms/receive``. -1. Configure your Twilio settings in the environment variables section in - ``src/main/appengine/app.yaml``. - -## Running locally - -You can run the application locally to test the callbacks and SMS sending. You -will need to set environment variables before starting your application: - - $ export TWILIO_ACCOUNT_SID=[your-twilio-accoun-sid] - $ export TWILIO_AUTH_TOKEN=[your-twilio-auth-token] - $ export TWILIO_NUMBER=[your-twilio-number] - $ mvn clean jetty:run diff --git a/flexible/twilio/pom.xml b/flexible/twilio/pom.xml deleted file mode 100644 index 2fa8fbed988..00000000000 --- a/flexible/twilio/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - war - 1.0-SNAPSHOT - com.example.flexible - twilio - - - doc-samples - com.google.cloud - 1.0.0 - ../.. - - - - 1.8 - 1.8 - - 1.0.0 - 9.3.8.v20160314 - - false - - - - - - com.twilio.sdk - twilio-java-sdk - 6.3.0 - - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - provided - - - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - - com.google.cloud.tools - appengine-maven-plugin - ${appengine.maven.plugin} - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.maven.plugin} - - - - diff --git a/flexible/twilio/src/main/appengine/app.yaml b/flexible/twilio/src/main/appengine/app.yaml deleted file mode 100644 index 1ee3836bcef..00000000000 --- a/flexible/twilio/src/main/appengine/app.yaml +++ /dev/null @@ -1,13 +0,0 @@ -runtime: java -env: flex - -handlers: -- url: /.* - script: this field is required, but ignored - -# [START env_variables] -env_variables: - TWILIO_ACCOUNT_SID: YOUR-TWILIO-ACCOUNT-SID - TWILIO_AUTH_TOKEN: YOUR-TWILIO-AUTH-TOKEN - TWILIO_NUMBER: YOUR-TWILIO-NUMBER -# [END env_variables]