@@ -0,0 +1,2117 @@
+/*****************************************************************************%0A ** Copyright (c) 2010 - 2012 Ushahidi Inc%0A ** All rights reserved%0A ** Contact: team@ushahidi.com%0A ** Website: http://www.ushahidi.com%0A **%0A ** GNU Lesser General Public License Usage%0A ** This file may be used under the terms of the GNU Lesser%0A ** General Public License version 3 as published by the Free Software%0A ** Foundation and appearing in the file LICENSE.LGPL included in the%0A ** packaging of this file. Please review the following information to%0A ** ensure the GNU Lesser General Public License version 3 requirements%0A ** will be met: http://www.gnu.org/licenses/lgpl.html.%0A **%0A **%0A ** If you have questions regarding the use of this file, please contact%0A ** Ushahidi developers at team@ushahidi.com.%0A **%0A *****************************************************************************/%0Apackage com.crowdmap.java.sdk.service;%0A%0Aimport static com.crowdmap.java.sdk.net.ICrowdmapConstants.SEGMENT_EXTERNALS;%0A%0Aimport com.crowdmap.java.sdk.json.ExternalsJson;%0Aimport com.crowdmap.java.sdk.net.CrowdmapHttpClient;%0A%0A/**%0A * Externals service%0A */%0Apublic class ExternalsService extends BaseService %7B%0A%0A%09/**%0A%09 * Create a new external service with the default crowdmap HTTP client%0A%09 */%0A%09public ExternalsService() %7B%0A%09%09super();%0A%09%7D%0A%0A%09/**%0A%09 * Create a new externals service with a configured crowdmap HTTP client%0A%09 * %0A%09 * @param client%0A%09 */%0A%09public ExternalsService(CrowdmapHttpClient client) %7B%0A%09%09super(client);%0A%09%7D%0A%0A%09/**%0A%09 * Get all externals. GET /externals%0A%09 * %0A%09 * @return %0A%09 */%0A%09public ExternalsJson getExternals() %7B%0A%0A%09%09StringBuilder url = new StringBuilder(apiUrl);%0A%09%09url.append(SEGMENT_EXTERNALS);%0A%0A%09%09return fromString(client.sendGetRequest(url.toString()),%0A%09%09%09%09ExternalsJson.class);%0A%09%7D%0A%0A%09/**%0A%09 * Get specific external. GET /externals/:external_id%0A%09 * %0A%09 * @param id%0A%09 * @return%0A%09 */%0A%09public ExternalsJson getExternal(String id) %7B%0A%09%09StringBuilder url = new StringBuilder(apiUrl);%0A%09%09url.append(SEGMENT_EXTERNALS);%0A%09%09url.append(%22/%22);%0A%09%09url.append(id);%0A%0A%09%09return fromString(client.sendGetRequest(url.toString()),%0A%09%09%09%09ExternalsJson.class);%0A%0A%09%7D%0A%7D%0A

Add externals service