Skip to content

Commit df3fa58

Browse files
committed
RESTful client with Spring RestTemplate
1 parent d5c556f commit df3fa58

File tree

27 files changed

+786
-42
lines changed

27 files changed

+786
-42
lines changed

Book-RESTful-Service/.classpath

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="output" path="target/classes"/>
26+
</classpath>

Book-RESTful-Service/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

Book-RESTful-Service/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>book-rest-service</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding//src/test/java=UTF-8
4+
encoding/<project>=UTF-8
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
3+
org.eclipse.jdt.core.compiler.compliance=1.8
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

Book-RESTful-Service/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Book_RESTful-Service
2+
3+
4+
## 1. Import source code into Eclipse
5+
6+
Menu **File –> Import –> Maven –> Existing Maven Projects**
7+
8+
Browse to your source code location
9+
10+
Click **Finish** button to finish the importing
11+
12+
## 2. Run the example
13+
14+
Open the **Application.java**
15+
16+
**Right click -> Run As -> Java Application** or use the shortcut: **Alt+Shift+x, j** to start the main method
17+
18+
19+
This RESTful ws provides API for all below sub projects:
20+
###[Simple Java RESTful Web Service Clients](http://howtoprogram.xyz/2016/07/02/java-restful-web-service-clients/)
21+
###[RESTful Client With Spring RestTemplate]([java-restful-client-spring-resttemplate](http://howtoprogram.xyz/2016/07/03/java-restful-client-spring-resttemplate/)

Book-RESTful-Service/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE")
7+
}
8+
}
9+
10+
apply plugin: 'java'
11+
apply plugin: 'eclipse'
12+
apply plugin: 'idea'
13+
apply plugin: 'spring-boot'
14+
15+
jar {
16+
baseName = 'gs-rest-service'
17+
version = '0.1.0'
18+
}
19+
20+
repositories {
21+
mavenCentral()
22+
}
23+
24+
sourceCompatibility = 1.8
25+
targetCompatibility = 1.8
26+
27+
dependencies {
28+
compile("org.springframework.boot:spring-boot-starter-web")
29+
testCompile('org.springframework.boot:spring-boot-starter-test')
30+
testCompile('com.jayway.jsonpath:json-path')
31+
}
32+
33+
task wrapper(type: Wrapper) {
34+
gradleVersion = '2.3'
35+
}
49.8 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sun Mar 15 13:55:04 EDT 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip

0 commit comments

Comments
 (0)