/** * Write binary content with content type header set to given <code>mime type</code> parameter. * * @param mimeType mime type which is written and used as content type header information. * @param data which is written to {@link ODataResponse}. * @return response object resulting {@link ODataResponse} with written binary content. * @throws EntityProviderException if writing of data (serialization) fails */ public static ODataResponse writeBinary(final String mimeType, final byte[] data) throws EntityProviderException { return createEntityProvider().writeBinary(mimeType, data); }
/** * Read (de-serialize) data from metadata <code>inputStream</code> (as {@link InputStream}) and provide Edm as * {@link Edm} * * @param metadataXml a metadata xml input stream (means the metadata document) * @param validate has to be true if metadata should be validated * @return Edm as {@link Edm} * @throws EntityProviderException if reading of data (de-serialization) fails */ public static Edm readMetadata(final InputStream metadataXml, final boolean validate) throws EntityProviderException { return createEntityProvider().readMetadata(metadataXml, validate); }
/** * Write responses of Batch Response Parts in Batch Response as {@link ODataResponse}. * Batch Response body matches one-to-one with the corresponding Batch Request body * * @param batchResponseParts a list of {@link BatchResponsePart} * @return Batch Response as {@link ODataResponse} * @throws BatchException */ public static ODataResponse writeBatchResponse(final List<BatchResponsePart> batchResponseParts) throws BatchException { return createEntityProvider().writeBatchResponse(batchResponseParts); }
public static ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) { final ODataEntityProviderPropertiesBuilder builder = EntityProviderWriteProperties.serviceRoot(properties.getServiceRoot()); return builder.fromProperties(properties); } }
/** * <p>Serializes an error message according to the OData standard.</p> * An exception is not thrown because this method is used in exception handling.</p> * @param context contains error details see {@link ODataErrorContext} * @return an {@link ODataResponse} containing the serialized error message */ public static ODataResponse writeErrorDocument(final ODataErrorContext context) { return createEntityProvider().writeErrorDocument(context); }
/** * Read (de-serialize) binary data from <code>content</code> (as {@link InputStream}) and provide it as * <code>byte[]</code>. * * @param content data in form of an {@link InputStream} which contains the binary data * @return binary data as bytes * @throws EntityProviderException if reading of data (de-serialization) fails */ public static byte[] readBinary(final InputStream content) throws EntityProviderException { return createEntityProvider().readBinary(content); }
/** * Write text value as content type <code>text/plain</code>. * * @param value text value which will be written * @return resulting {@link ODataResponse} with written text/plain content. * @throws EntityProviderException if writing of data (serialization) fails */ public static ODataResponse writeText(final String value) throws EntityProviderException { return createEntityProvider().writeText(value); }
/** * Write property as content type <code>application/octet-stream</code> or <code>text/plain</code>. * * @param edmProperty entity data model for to be written property * @param value property which will be written * @return resulting {@link ODataResponse} with written property value content. * @throws EntityProviderException if writing of data (serialization) fails */ public static ODataResponse writePropertyValue(final EdmProperty edmProperty, final Object value) throws EntityProviderException { return createEntityProvider().writePropertyValue(edmProperty, value); }
/** * Create Batch Request body as InputStream. * * @param batchParts a list of BatchPartRequests {@link BatchPart} * @param boundary * @return Batch Request as InputStream */ public static InputStream writeBatchRequest(final List<BatchPart> batchParts, final String boundary) { return createEntityProvider().writeBatchRequest(batchParts, boundary); }
public static ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) { final ODataEntityProviderPropertiesBuilder builder = EntityProviderWriteProperties.serviceRoot(properties.getServiceRoot()); return builder.fromProperties(properties); } }
/** * <p>Serializes an error message according to the OData standard.</p> * An exception is not thrown because this method is used in exception handling.</p> * @param context contains error details see {@link ODataErrorContext} * @return an {@link ODataResponse} containing the serialized error message */ public static ODataResponse writeErrorDocument(final ODataErrorContext context) { return createEntityProvider().writeErrorDocument(context); }
/** * Read (de-serialize) binary data from <code>content</code> (as {@link InputStream}) and provide it as * <code>byte[]</code>. * * @param content data in form of an {@link InputStream} which contains the binary data * @return binary data as bytes * @throws EntityProviderException if reading of data (de-serialization) fails */ public static byte[] readBinary(final InputStream content) throws EntityProviderException { return createEntityProvider().readBinary(content); }
/** * Write binary content with content type header set to given <code>mime type</code> parameter. * * @param mimeType mime type which is written and used as content type header information. * @param data which is written to {@link ODataResponse}. * @return response object resulting {@link ODataResponse} with written binary content. * @throws EntityProviderException if writing of data (serialization) fails */ public static ODataResponse writeBinary(final String mimeType, final byte[] data) throws EntityProviderException { return createEntityProvider().writeBinary(mimeType, data); }
/** * Read (de-serialize) data from metadata <code>inputStream</code> (as {@link InputStream}) and provide Edm as * {@link Edm} * * @param metadataXml a metadata xml input stream (means the metadata document) * @param validate has to be true if metadata should be validated * @return Edm as {@link Edm} * @throws EntityProviderException if reading of data (de-serialization) fails */ public static Edm readMetadata(final InputStream metadataXml, final boolean validate) throws EntityProviderException { return createEntityProvider().readMetadata(metadataXml, validate); }
/** * Write responses of Batch Response Parts in Batch Response as {@link ODataResponse}. * Batch Response body matches one-to-one with the corresponding Batch Request body * * @param batchResponseParts a list of {@link BatchResponsePart} * @return Batch Response as {@link ODataResponse} * @throws BatchException */ public static ODataResponse writeBatchResponse(final List<BatchResponsePart> batchResponseParts) throws BatchException { return createEntityProvider().writeBatchResponse(batchResponseParts); }
/** * Write text value as content type <code>text/plain</code>. * * @param value text value which will be written * @return resulting {@link ODataResponse} with written text/plain content. * @throws EntityProviderException if writing of data (serialization) fails */ public static ODataResponse writeText(final String value) throws EntityProviderException { return createEntityProvider().writeText(value); }
/** * <p>Serializes an error message according to the OData standard.</p> * An exception is not thrown because this method is used in exception handling.</p> * @param context contains error details see {@link ODataErrorContext} * @return an {@link ODataResponse} containing the serialized error message */ public static ODataResponse writeErrorDocument(final ODataErrorContext context) { return createEntityProvider().writeErrorDocument(context); }
/** * Read (de-serialize) binary data from <code>content</code> (as {@link InputStream}) and provide it as * <code>byte[]</code>. * * @param content data in form of an {@link InputStream} which contains the binary data * @return binary data as bytes * @throws EntityProviderException if reading of data (de-serialization) fails */ public static byte[] readBinary(final InputStream content) throws EntityProviderException { return createEntityProvider().readBinary(content); }
/** * <p>Serializes an error message according to the OData standard.</p> * An exception is not thrown because this method is used in exception handling.</p> * @param context contains error details see {@link ODataErrorContext} * @return an {@link ODataResponse} containing the serialized error message */ public static ODataResponse writeErrorDocument(final ODataErrorContext context) { return createEntityProvider().writeErrorDocument(context); }
/** * Read (de-serialize) binary data from <code>content</code> (as {@link InputStream}) and provide it as * <code>byte[]</code>. * * @param content data in form of an {@link InputStream} which contains the binary data * @return binary data as bytes * @throws EntityProviderException if reading of data (de-serialization) fails */ public static byte[] readBinary(final InputStream content) throws EntityProviderException { return createEntityProvider().readBinary(content); }