HttpClient httpClient = new DefaultHttpClient();
SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
.getSchemeRegistry().getScheme("https").getSocketFactory();
sf.setHostnameVerifier(new AllowAllHostnameVerifier());
HttpPut request = new HttpPut(Application.baseRestUrl + "/communities/" + this.id);
request.setHeader("Accept", "application/json");
request.addHeader("Content-Type", "application/json");
request.addHeader("rest-dspace-token", token);
//Only allow certain attributes... "name", "copyrightText", "introductoryText", "shortDescription", "sidebarText"
Logger.info("EditCommunity json: " + Json.toJson(this).toString());
ObjectNode jsonObjectNode = Json.newObject().put("name", this.name).put("copyrightText", this.copyrightText)
.put("introductoryText", this.introductoryText)
.put("shortDescription", this.shortDescription)
.put("sidebarText", this.sidebarText);
StringEntity stringEntity = new StringEntity(jsonObjectNode.toString());
Logger.info("EditCommunity certain attributes: " + jsonObjectNode.toString());
request.setEntity(stringEntity);
HttpResponse httpResponse = httpClient.execute(request);
RestResponse restResponse = new RestResponse();
restResponse.httpResponse = httpResponse;
restResponse.endpoint = request.getURI().toString();
return restResponse;
}