Skip to content

Commit b3b9e3e

Browse files
committed
update document
1 parent 1fa404a commit b3b9e3e

File tree

5 files changed

+15
-33
lines changed

5 files changed

+15
-33
lines changed

Book-RESTful-Service/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ This RESTful ws provides API for all below sub projects:
2121
###[RESTful Client With Spring RestTemplate](http://howtoprogram.xyz/2016/07/03/java-restful-client-spring-resttemplate/)
2222
###[Java RESTful Client With Apache Httpcomponents](http://howtoprogram.xyz/2016/07/04/java-restful-client-spring-apache-httpcomponents/)
2323
###[Java RESTful Client With Jersey Client](http://howtoprogram.xyz/2016/07/05/java-restful-client-jersey-client/)
24-
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
24+
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
25+
###[Java RESTful Client With Resteasy Client Proxy Framework](http://howtoprogram.xyz/2016/07/13/java-restful-client-resteasy-proxy-framework/)

Java-JsonPojo-Example/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ Source code are described in **[Convert Java Objects To JSON And Vice Versa](htt
2121
###[RESTful Client With Spring RestTemplate](http://howtoprogram.xyz/2016/07/03/java-restful-client-spring-resttemplate/)
2222
###[Java RESTful Client With Apache Httpcomponents](http://howtoprogram.xyz/2016/07/04/java-restful-client-spring-apache-httpcomponents/)
2323
###[Java RESTful Client With Jersey Client](http://howtoprogram.xyz/2016/07/05/java-restful-client-jersey-client/)
24-
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
24+
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
25+
###[Java RESTful Client With Resteasy Client Proxy Framework](http://howtoprogram.xyz/2016/07/13/java-restful-client-resteasy-proxy-framework/)

Java-RESTful-Client-Example/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ The **BookRepositoryImplSpring.java** includes all raw examples about creating R
1717
The **BookRepositoryImplApacheHttpClient.java** includes all raw examples about creating RESTful Client With Apache Httpcomponents
1818
The **BookRepositoryImplJersey.java** includes all raw examples about creating RESTful Client With Jersey Client library.
1919
The **BookRepositoryImplResteasy.java** includes all raw examples about creating RESTful Client With Resteasy Client API.
20+
The **BookRepositoryImplResteasyProxy.java, SimpleResteasyProxyClient.java** includes all raw examples about creating RESTful Client With Resteasy Client Proxy Framework.
2021

2122
Source code are described:
2223
###[Simple Java RESTful Web Service Clients](http://howtoprogram.xyz/2016/07/02/java-restful-web-service-clients/)
2324
###[Java RESTful Client With Spring RestTemplate](http://howtoprogram.xyz/2016/07/03/java-restful-client-spring-resttemplate/)
2425
###[Convert Java Objects To JSON And Vice Versa](http://howtoprogram.xyz/2016/07/01/convert-java-objects-json-vice-versa/)
2526
###[Java RESTful Client With Apache Httpcomponents](http://howtoprogram.xyz/2016/07/04/java-restful-client-spring-apache-httpcomponents/)
2627
###[Java RESTful Client With Jersey Client](http://howtoprogram.xyz/2016/07/05/java-restful-client-jersey-client/)
27-
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
28+
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
29+
###[Java RESTful Client With Resteasy Client Proxy Framework](http://howtoprogram.xyz/2016/07/13/java-restful-client-resteasy-proxy-framework/)

Java-RESTful-Client-Example/src/main/java/com/howtoprogram/repository/resteasyproxy/BookRepositoryImplResteasyProxy.java

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,8 @@ public void deleteBook(Long id) {
1818
simpleClient.deleteBook(id);
1919
}
2020

21-
public static void main(String[] args) throws Exception {
22-
BookRepositoryImplResteasyProxy bookRepository = new BookRepositoryImplResteasyProxy();
23-
Book book = bookRepository.getAllBooks().get(0);
24-
bookRepository.deleteBook(book.getId());
25-
}
26-
27-
/*
28-
* public static void main(String[] args) throws Exception { BookRepositoryImplResteasyProxy
29-
* bookRepository = new BookRepositoryImplResteasyProxy(); // Getting the first book from the
30-
* RESTful service Book book = bookRepository.getAllBooks().get(0); System.out.println(book); //
31-
* Change the name book.setName(book.getName() + " 3rd"); // Then update the book book =
32-
* bookRepository.updateBook(book); System.out.println(book); }
33-
*/
34-
35-
36-
/*
37-
* public static void main(String[] args) throws Exception { BookRepositoryImplResteasyProxy
38-
* bookRepository = new BookRepositoryImplResteasyProxy(); Book book = new Book(null,
39-
* "Effective Java", "Joshua Bloch"); Book createdBook = bookRepository.createBook(book);
40-
* System.out.println(createdBook); }
41-
*/
42-
4321

44-
/*
45-
* public static void main(String[] args) throws Exception { BookRepositoryImplResteasyProxy
46-
* bookRepository = new BookRepositoryImplResteasyProxy(); List<Book> books =
47-
* bookRepository.getAllBooks(); System.out.println(books); }
48-
*/
4922
public Book updateBook(Book book) throws Exception {
50-
5123
ResteasyClient client = new ResteasyClientBuilder().build();
5224
ResteasyWebTarget target = client.target(URI_BOOK);
5325
SimpleResteasyProxyClient simpleClient = target.proxy(SimpleResteasyProxyClient.class);
@@ -68,8 +40,13 @@ public Book createBook(Book book) throws Exception {
6840

6941

7042

71-
public List<Book> getAllBooks() throws Exception {
43+
public static void main(String[] args) throws Exception {
44+
BookRepositoryImplResteasyProxy bookRepository = new BookRepositoryImplResteasyProxy();
45+
Book book = bookRepository.getAllBooks().get(0);
46+
bookRepository.deleteBook(book.getId());
47+
}
7248

49+
public List<Book> getAllBooks() throws Exception {
7350
ResteasyClient client = new ResteasyClientBuilder().build();
7451
ResteasyWebTarget target = client.target(URI_BOOK);
7552
SimpleResteasyProxyClient simpleClient = target.proxy(SimpleResteasyProxyClient.class);

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ This RESTful ws provides API for all below sub projects
1111
###[RESTful Client With Spring RestTemplate](http://howtoprogram.xyz/2016/07/03/java-restful-client-spring-resttemplate/)
1212
###[Java RESTful Client With Apache Httpcomponents](http://howtoprogram.xyz/2016/07/04/java-restful-client-spring-apache-httpcomponents/)
1313
###[Java RESTful Client With Jersey Client](http://howtoprogram.xyz/2016/07/05/java-restful-client-jersey-client/)
14-
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
14+
###[Java RESTful Client With Resteasy Client](http://howtoprogram.xyz/2016/07/12/java-restful-client-resteasy-client/)
15+
###[Java RESTful Client With Resteasy Client Proxy Framework](http://howtoprogram.xyz/2016/07/13/java-restful-client-resteasy-proxy-framework/)

0 commit comments

Comments
 (0)