| | |
| | | import com.gitblit.models.FederationSet;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.models.ServerStatus;
|
| | | import com.gitblit.models.SettingModel;
|
| | | import com.gitblit.models.ServerSettings;
|
| | | import com.gitblit.models.UserModel;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | |
|
| | |
| | | }.getType();
|
| | |
|
| | | private static final Type SETS_TYPE = new TypeToken<Collection<FederationSet>>() {
|
| | | }.getType();
|
| | |
|
| | | private static final Type SETTINGS_TYPE = new TypeToken<Map<String, SettingModel>>() {
|
| | | }.getType();
|
| | |
|
| | | /**
|
| | |
| | | * @param serverUrl
|
| | | * @param account
|
| | | * @param password
|
| | | * @return an Map<String, SettingModel> object
|
| | | * @return an Settings object
|
| | | * @throws IOException
|
| | | */
|
| | | public static Map<String, SettingModel> getSettings(String serverUrl, String account,
|
| | | char[] password) throws IOException {
|
| | | public static ServerSettings getSettings(String serverUrl, String account, char[] password)
|
| | | throws IOException {
|
| | | String url = asLink(serverUrl, RpcRequest.LIST_SETTINGS);
|
| | | Map<String, SettingModel> settings = JsonUtils.retrieveJson(url, SETTINGS_TYPE, account,
|
| | | password);
|
| | | ServerSettings settings = JsonUtils.retrieveJson(url, ServerSettings.class, account, password);
|
| | | return settings;
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public static ServerStatus getStatus(String serverUrl, String account, char[] password)
|
| | | throws IOException {
|
| | | String url = asLink(serverUrl, RpcRequest.LIST_SERVER_STATUS);
|
| | | String url = asLink(serverUrl, RpcRequest.LIST_STATUS);
|
| | | ServerStatus status = JsonUtils.retrieveJson(url, ServerStatus.class, account, password);
|
| | | return status;
|
| | | }
|