bucketName,
key);
try {
val = extractValue(result, origType, requiredType);
} catch (IOException ioe) {
throw new DataStoreOperationException(ioe.getMessage(), ioe);
}
break;
case NOT_FOUND:
// IGNORED
break;
default:
throw new DataStoreOperationException(e.getMessage(), e);
}
if (e.getStatusCode() != HttpStatus.NOT_FOUND) {
throw new DataStoreOperationException(e.getMessage(), e);
}
} catch (RestClientException rce) {
if (rce.getMessage().contains("HTTP response code: 406")) {
// Can't convert using HttpMessageConverter. Try fetching as the original type
// and using the conversion service to convert.
ResponseEntity<?> result = restTemplate.getForEntity(defaultUri,
origType,
bucketName,
key);
try {
val = extractValue(result, origType, requiredType);
} catch (IOException ioe) {
throw new DataStoreOperationException(rce.getMessage(), rce);
}
} else {
// IGNORE
if (log.isDebugEnabled()) {
log.debug("RestClientException: " + rce.getMessage());