Exemplo n.º 1
0
 private String createBatchUri(Olingo2BatchRequest part) {
   String result;
   if (part instanceof Olingo2BatchQueryRequest) {
     final Olingo2BatchQueryRequest queryPart = (Olingo2BatchQueryRequest) part;
     result = createUri(queryPart.getResourcePath(), queryPart.getQueryParams());
   } else {
     result = createUri(part.getResourcePath());
   }
   // strip base URI
   return result.substring(serviceUri.length() + 1);
 }
Exemplo n.º 2
0
  private BatchQueryPart createBatchQueryPart(
      UriInfoWithType uriInfo, Olingo2BatchQueryRequest batchRequest) {

    final Map<String, String> headers = new HashMap<String, String>(batchRequest.getHeaders());
    if (!headers.containsKey(HttpHeaders.ACCEPT)) {
      // Olingo is sensitive to batch part charset case!!
      headers.put(HttpHeaders.ACCEPT, getResourceContentType(uriInfo).toString().toLowerCase());
    }

    return BatchQueryPart.method("GET").uri(createBatchUri(batchRequest)).headers(headers).build();
  }