Exemple #1
0
  private void batchUpdateMediaResource(
      final EntityTypeInvocationHandler handler,
      final URI uri,
      final InputStream input,
      final ODataChangeset changeset) {

    LOG.debug("Update media entity '{}'", uri);

    final ODataStreamUpdateRequest req =
        ODataStreamedRequestFactory.getStreamUpdateRequest(uri, input);

    if (StringUtils.isNotBlank(handler.getETag())) {
      req.setIfMatch(handler.getETag());
    }

    changeset.addRequest(req);
  }
Exemple #2
0
  private void batchUpdateMediaEntity(
      final EntityTypeInvocationHandler handler,
      final URI uri,
      final InputStream input,
      final ODataChangeset changeset) {

    LOG.debug("Update media entity '{}'", uri);

    final ODataMediaEntityUpdateRequest req =
        ODataStreamedRequestFactory.getMediaEntityUpdateRequest(uri, input);

    req.setContentType(
        StringUtils.isBlank(handler.getEntity().getMediaContentType())
            ? ODataMediaFormat.WILDCARD.toString()
            : ODataMediaFormat.fromFormat(handler.getEntity().getMediaContentType()).toString());

    if (StringUtils.isNotBlank(handler.getETag())) {
      req.setIfMatch(handler.getETag());
    }

    changeset.addRequest(req);
  }