From f8a2126f10a8e93945a8f168d900020337df1f96 Mon Sep 17 00:00:00 2001 From: kske Date: Sat, 28 Sep 2019 11:51:52 +0200 Subject: [PATCH] Added Maven project --- .classpath | 38 ++++++++++++++++++++++ .gitignore | 1 + .project | 23 +++++++++++++ .settings/org.eclipse.core.resources.prefs | 6 ++++ .settings/org.eclipse.jdt.core.prefs | 8 +++++ .settings/org.eclipse.m2e.core.prefs | 4 +++ pom.xml | 31 ++++++++++++++++++ src/main/java/envoy/EnvoyClient.java | 25 ++++++++++++++ 8 files changed, 136 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 pom.xml create mode 100644 src/main/java/envoy/EnvoyClient.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..d2bc4e0 --- /dev/null +++ b/.classpath @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/.project b/.project new file mode 100644 index 0000000..cc0e903 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + envoy-client + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..04cfa2c --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cb635b1 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d04ce4b --- /dev/null +++ b/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + + informatik-ag-ngl + envoy-client + 0.0.1-SNAPSHOT + + Envoy Client + https://github.com/informatik-ag-ngl/envoy-client + + + UTF-8 + UTF-8 + 1.8 + 1.8 + + + + + org.jboss.resteasy + resteasy-client + 4.1.1.Final + + + + + envoy-client + + \ No newline at end of file diff --git a/src/main/java/envoy/EnvoyClient.java b/src/main/java/envoy/EnvoyClient.java new file mode 100644 index 0000000..29a6cc0 --- /dev/null +++ b/src/main/java/envoy/EnvoyClient.java @@ -0,0 +1,25 @@ +package envoy; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Response; + +/** + * Project: envoy-client
+ * File: EnvoyClient.java
+ * Created: 28 Sep 2019
+ * Author: Kai S. K. Engelbart + */ +public class EnvoyClient { + + public static void main(String[] args) { + Client client = ClientBuilder.newClient(); + WebTarget target = client.target("http://localhost:8080/envoy-server/rest/hello?name=InformatikAGNGL"); + Response response = target.request().get(); + String value = response.readEntity(String.class); + response.close(); + + System.out.printf("Response form server: %s%n", value); + } +}