* IMPORTANT: Make sure to release the Response in a finally block when you are done with it.
*/
public Response sendMessage(Method method, RepositoryGroupResource resource, String id)
throws IOException
{
XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType);
String idPart = (method == Method.POST) ? "" : "/" + id;
String serviceURI = SERVICE_PART + idPart;
RepositoryGroupResourceResponse repoResponseRequest = new RepositoryGroupResourceResponse();
repoResponseRequest.setData(resource);
// now set the payload
representation.setPayload(repoResponseRequest);
LOG.debug("sendMessage: " + representation.getText());
return nexusRestClient.sendMessage(serviceURI, method, representation);
}