comparison src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java @ 37:874c25363dc9 2.9

Added new method findUser to HttpClient With the new method it is possible to get a document by an account name. http-client/trunk@5259 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Fri, 24 Aug 2012 13:59:12 +0000
parents 875a5c409560
children
comparison
equal deleted inserted replaced
36:60f50a2f0168 37:874c25363dc9
55 public static final String PATH_USER_COLLECTIONS = "/list-collections"; 55 public static final String PATH_USER_COLLECTIONS = "/list-collections";
56 56
57 /** The URL part og the resource to create a new user on the server.*/ 57 /** The URL part og the resource to create a new user on the server.*/
58 public static final String PATH_CREATE_USER = "/create-user"; 58 public static final String PATH_CREATE_USER = "/create-user";
59 59
60 /** The URL part og the resource to find an existing user on the server.*/
61 public static final String PATH_FIND_USER = "/find-user";
62
60 /** The URL part of the resource to call a specific service.*/ 63 /** The URL part of the resource to call a specific service.*/
61 public static final String PATH_SERVICE = "/service"; 64 public static final String PATH_SERVICE = "/service";
62 65
63 /** The URL path of the resource to create new artifact collections.*/ 66 /** The URL path of the resource to create new artifact collections.*/
64 public static final String PATH_CREATE_COLLECTION = "/create-collection"; 67 public static final String PATH_CREATE_COLLECTION = "/create-collection";
552 catch (IOException ioe) { 555 catch (IOException ioe) {
553 throw new ConnectionException( 556 throw new ConnectionException(
554 "Connection to server failed: " + ioe.getMessage()); 557 "Connection to server failed: " + ioe.getMessage());
555 } 558 }
556 } 559 }
560
561 @Override
562 public Document findUser(Document doc)
563 throws ConnectionException {
564 ResponseHandler handler = new DocumentResponseHandler();
565
566 String url = this.serverUrl + PATH_FIND_USER;
567
568 try {
569 return (Document) handler.handle(doPost(url, doc));
570 }
571 catch (IOException ioe) {
572 throw new ConnectionException(
573 "Connection to server failed: " + ioe.getMessage());
574 }
575 }
557 } 576 }
558 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: 577 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org