From 3928544560cb7f6cd1bff4bf975eea5f5d10fda2 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 09 Aug 2013 10:16:16 -0400
Subject: [PATCH] Update to Moxie 0.8.1 and include gbapi in Maven repository on RELEASE build
---
src/main/java/com/gitblit/utils/RpcUtils.java | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/RpcUtils.java b/src/main/java/com/gitblit/utils/RpcUtils.java
index cd80fc4..290be49 100644
--- a/src/main/java/com/gitblit/utils/RpcUtils.java
+++ b/src/main/java/com/gitblit/utils/RpcUtils.java
@@ -297,6 +297,24 @@
char[] password) throws IOException {
return doAction(RpcRequest.DELETE_USER, null, user, serverUrl, account, password);
}
+
+ /**
+ * Tries to get the specified gitblit user account from the remote gitblit instance.
+ * If the username is null or empty, the current user is returned.
+ *
+ * @param username
+ * @param serverUrl
+ * @param account
+ * @param password
+ * @return a UserModel or null
+ * @throws IOException
+ */
+ public static UserModel getUser(String username, String serverUrl, String account, char[] password)
+ throws IOException {
+ String url = asLink(serverUrl, RpcRequest.GET_USER);
+ UserModel model = JsonUtils.retrieveJson(url, UserModel.class, account, password);
+ return model;
+ }
/**
* Create a team on the Gitblit server.
--
Gitblit v1.9.1