Package org.apache.olingo.odata2.api.processor.ODataResponse

Examples of org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilder.header()


    } catch (FactoryConfigurationError e) {
      throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
          .getSimpleName()), e);
    }
    builder.entity(csb.getInputStream());
    builder.header(ODataHttpHeaders.DATASERVICEVERSION, dataServiceVersion);
    return builder.build();
  }

  /**
   * Calculates the necessary data service version for the metadata serialization
View Full Code Here


              .getIdLiteral() : null;
      final HttpStatusCodes s = getStatusCode(odataResponse, method, uriType);
      extendedResponse = extendedResponse.idLiteral(location).status(s);

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
      if (!HttpStatusCodes.NO_CONTENT.equals(s) && !odataResponse.containsHeader(HttpHeaders.CONTENT_TYPE)) {
        extendedResponse.header(HttpHeaders.CONTENT_TYPE, acceptContentType.toContentTypeString());
      }
View Full Code Here

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
      if (!HttpStatusCodes.NO_CONTENT.equals(s) && !odataResponse.containsHeader(HttpHeaders.CONTENT_TYPE)) {
        extendedResponse.header(HttpHeaders.CONTENT_TYPE, acceptContentType.toContentTypeString());
      }

      odataResponse = extendedResponse.build();
    } catch (final Exception e) {
      exception = e;
View Full Code Here

      writer.flush();
      buffer.closeWrite();

      ODataResponseBuilder response = ODataResponse.entity(buffer.getInputStream());
      if (properties.getInlineCountType() != InlineCount.ALLPAGES) {
        response = response.header(ODataHttpHeaders.DATASERVICEVERSION, ODataServiceVersion.V10);
      }
      return response.build();
    } catch (EntityProviderException e) {
      buffer.close();
      throw e;
View Full Code Here

    } catch (FactoryConfigurationError e) {
      throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
          .getSimpleName()), e);
    }
    builder.entity(csb.getInputStream());
    builder.header(ODataHttpHeaders.DATASERVICEVERSION, dataServiceVersion);
    return builder.build();
  }

  /**
   * Calculates the necessary data service version for the metadata serialization
View Full Code Here

              .getIdLiteral() : null;
      final HttpStatusCodes s = getStatusCode(odataResponse, method, uriType);
      extendedResponse = extendedResponse.idLiteral(location).status(s);

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
      if (!HttpStatusCodes.NO_CONTENT.equals(s) && !odataResponse.containsHeader(HttpHeaders.CONTENT_TYPE)) {
        extendedResponse.header(HttpHeaders.CONTENT_TYPE, acceptContentType.toContentTypeString());
      }
View Full Code Here

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
      if (!HttpStatusCodes.NO_CONTENT.equals(s) && !odataResponse.containsHeader(HttpHeaders.CONTENT_TYPE)) {
        extendedResponse.header(HttpHeaders.CONTENT_TYPE, acceptContentType.toContentTypeString());
      }

      odataResponse = extendedResponse.build();
    } catch (final Exception e) {
      exception = e;
View Full Code Here

  public ODataResponse handleError(final ODataErrorContext context) {
    ODataResponseBuilder responseBuilder =
        ODataResponse.entity("bla").status(HttpStatusCodes.BAD_REQUEST).contentHeader("text/html");

    if (context.getRequestUri() != null) {
      responseBuilder.header("RequestUri", context.getRequestUri().toASCIIString());
      PathInfo pathInfo = context.getPathInfo();
      if (pathInfo == null) {
        responseBuilder.header("PathInfo", "NULL");
      } else {
        responseBuilder.header("PathInfo", "TRUE");
View Full Code Here

    if (context.getRequestUri() != null) {
      responseBuilder.header("RequestUri", context.getRequestUri().toASCIIString());
      PathInfo pathInfo = context.getPathInfo();
      if (pathInfo == null) {
        responseBuilder.header("PathInfo", "NULL");
      } else {
        responseBuilder.header("PathInfo", "TRUE");
        responseBuilder.header("PathInfo.oDataSegments", pathInfo.getODataSegments().toString());
        responseBuilder.header("PathInfo.precedingSegments", pathInfo.getPrecedingSegments().toString());
        responseBuilder.header("PathInfo.requestUri", pathInfo.getRequestUri().toString());
View Full Code Here

      responseBuilder.header("RequestUri", context.getRequestUri().toASCIIString());
      PathInfo pathInfo = context.getPathInfo();
      if (pathInfo == null) {
        responseBuilder.header("PathInfo", "NULL");
      } else {
        responseBuilder.header("PathInfo", "TRUE");
        responseBuilder.header("PathInfo.oDataSegments", pathInfo.getODataSegments().toString());
        responseBuilder.header("PathInfo.precedingSegments", pathInfo.getPrecedingSegments().toString());
        responseBuilder.header("PathInfo.requestUri", pathInfo.getRequestUri().toString());
        responseBuilder.header("PathInfo.serviceRoot", pathInfo.getServiceRoot().toString());
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.