httpResponse.setEntity(new StringEntity(body, charset));
}
AbstractFutureCallback.checkStatus(httpResponse);
} catch (ODataApplicationException e) {
return new Olingo2BatchResponse(
statusCode, statusInfo, response.getContentId(),
response.getHeaders(), e);
} catch (UnsupportedEncodingException e) {
return new Olingo2BatchResponse(
statusCode, statusInfo, response.getContentId(),
response.getHeaders(), e);
}
// resolve resource path and query params and parse batch part uri
final String resourcePath = request.getResourcePath();
final String resolvedResourcePath;
if (resourcePath.startsWith("$") && !(METADATA.equals(resourcePath) || BATCH.equals(resourcePath))) {
resolvedResourcePath = findLocation(resourcePath, contentIdLocationMap);
} else {
final String resourceLocation = response.getHeader(HttpHeaders.LOCATION);
resolvedResourcePath = resourceLocation != null
? resourceLocation.substring(serviceUri.length()) : resourcePath;
}
final Map<String, String> resolvedQueryParams = request instanceof Olingo2BatchQueryRequest
? ((Olingo2BatchQueryRequest) request).getQueryParams() : null;
final UriInfoImpl uriInfo = parseUri(edm, resolvedResourcePath, resolvedQueryParams);
// resolve response content
final Object resolvedContent = content != null ? readContent(uriInfo, content) : null;
return new Olingo2BatchResponse(statusCode, statusInfo, response.getContentId(), response.getHeaders(),
resolvedContent);
}