Mercurial > dive4elements > http-client
comparison src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java @ 7:06e9e25632cd 0.1
Added a method to the HttpClient to list the collection of a user.
http-client/trunk@1615 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 30 Mar 2011 07:48:39 +0000 |
parents | 09a84c6e263a |
children | 072e8d488f83 |
comparison
equal
deleted
inserted
replaced
6:09a84c6e263a | 7:06e9e25632cd |
---|---|
43 private static final Logger logger = Logger.getLogger(HttpClient.class); | 43 private static final Logger logger = Logger.getLogger(HttpClient.class); |
44 | 44 |
45 /** The URL part of the resource to list the existing users of the server.*/ | 45 /** The URL part of the resource to list the existing users of the server.*/ |
46 public static final String PATH_LIST_USERS = "/list-users"; | 46 public static final String PATH_LIST_USERS = "/list-users"; |
47 | 47 |
48 /** The URL part of the resource to list the Collections owned by a specific | |
49 * user.*/ | |
50 public static final String PATH_USER_COLLECTIONS = "/list-collections"; | |
51 | |
48 /** The URL part of the resource to call a specific service.*/ | 52 /** The URL part of the resource to call a specific service.*/ |
49 public static final String PATH_SERVICE = "/service"; | 53 public static final String PATH_SERVICE = "/service"; |
50 | 54 |
51 /** The URL path of the resource to create new artifact collections.*/ | 55 /** The URL path of the resource to create new artifact collections.*/ |
52 public static final String PATH_CREATE_COLLECTION = "/create-collection"; | 56 public static final String PATH_CREATE_COLLECTION = "/create-collection"; |
333 } | 337 } |
334 catch (IOException ioe) { | 338 catch (IOException ioe) { |
335 throw new ConnectionException(ioe.getMessage(), ioe); | 339 throw new ConnectionException(ioe.getMessage(), ioe); |
336 } | 340 } |
337 } | 341 } |
342 | |
343 | |
344 public Document listUserCollections(String userid) | |
345 throws ConnectionException | |
346 { | |
347 ResponseHandler handler = new DocumentResponseHandler(); | |
348 | |
349 String url = serverUrl + PATH_USER_COLLECTIONS + "/" + userid; | |
350 | |
351 try { | |
352 return (Document) handler.handle(doGet(url)); | |
353 } | |
354 catch (IOException ioe) { | |
355 throw new ConnectionException(ioe.getMessage(), ioe); | |
356 } | |
357 } | |
338 } | 358 } |
339 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: | 359 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |