request.getBody().write(file);
ClientHttpResponse response = request.execute();
ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
if (errorHandler.hasError(response)) {
errorHandler.handleError(response);
return null;
}
else {
InputStream stream = response.getBody();
return objectMapper.readValue(stream, Metadata.class);