# HG changeset patch # User Ingo Weinzierl # Date 1301471319 0 # Node ID 06e9e25632cdbd2cbb9c7afe5cc82614af6d818b # Parent 09a84c6e263a92b63aa9803a4c81980e522eddd1 Added a method to the HttpClient to list the collection of a user. http-client/trunk@1615 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 09a84c6e263a -r 06e9e25632cd ChangeLog --- a/ChangeLog Wed Mar 23 16:27:56 2011 +0000 +++ b/ChangeLog Wed Mar 30 07:48:39 2011 +0000 @@ -1,3 +1,9 @@ +2011-03-30 Ingo Weinzierl + + * src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java, + src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java: + Added a new method to list the collection of a specific user. + 2011-03-23 Ingo Weinzierl * src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java, diff -r 09a84c6e263a -r 06e9e25632cd src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Wed Mar 23 16:27:56 2011 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClient.java Wed Mar 30 07:48:39 2011 +0000 @@ -82,5 +82,8 @@ Document listUsers() throws ConnectionException; + + Document listUserCollections(String userid) + throws ConnectionException; } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 09a84c6e263a -r 06e9e25632cd src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java --- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Wed Mar 23 16:27:56 2011 +0000 +++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java Wed Mar 30 07:48:39 2011 +0000 @@ -45,6 +45,10 @@ /** The URL part of the resource to list the existing users of the server.*/ public static final String PATH_LIST_USERS = "/list-users"; + /** The URL part of the resource to list the Collections owned by a specific + * user.*/ + public static final String PATH_USER_COLLECTIONS = "/list-collections"; + /** The URL part of the resource to call a specific service.*/ public static final String PATH_SERVICE = "/service"; @@ -335,5 +339,21 @@ throw new ConnectionException(ioe.getMessage(), ioe); } } + + + public Document listUserCollections(String userid) + throws ConnectionException + { + ResponseHandler handler = new DocumentResponseHandler(); + + String url = serverUrl + PATH_USER_COLLECTIONS + "/" + userid; + + try { + return (Document) handler.handle(doGet(url)); + } + catch (IOException ioe) { + throw new ConnectionException(ioe.getMessage(), ioe); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: