diff src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java @ 4:19b3ba7f2568

Added a method to the http client to list the existing users of the artifact database. http-client/trunk@1412 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 07 Mar 2011 13:42:33 +0000
parents 19a617578b88
children 7917c21fad01
line wrap: on
line diff
--- a/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java	Fri Mar 04 11:49:49 2011 +0000
+++ b/src/main/java/de/intevation/artifacts/httpclient/http/HttpClientImpl.java	Mon Mar 07 13:42:33 2011 +0000
@@ -42,6 +42,9 @@
 
     private static final Logger logger = Logger.getLogger(HttpClient.class);
 
+    /** 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 path of the resource to create new artifact collections.*/
     public static final String PATH_CREATE_COLLECTION = "/create-collection";
 
@@ -254,5 +257,23 @@
 
         return response;
     }
+
+
+    /*******************************
+     * Users API
+     *******************************/
+    public Document listUsers()
+    throws ConnectionException
+    {
+        ResponseHandler handler = new DocumentResponseHandler();
+        String    url           = serverUrl + PATH_LIST_USERS;
+
+        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:

http://dive4elements.wald.intevation.org