Package com.emc.documentum.rest.wire
Class RestAbstractHttpMessageConverter<T>
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
com.emc.documentum.rest.wire.RestAbstractHttpMessageConverter<T>
- All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<T>
- Direct Known Subclasses:
AnnotatedJsonMessageConverter
,AnnotatedXmlMessageConverter
public abstract class RestAbstractHttpMessageConverter<T>
extends org.springframework.http.converter.AbstractHttpMessageConverter<T>
This class is used to override the addDefaultHeaders to support MediaType.APPLICATION_OCTET_STREAM content-type
header, as the Spring does not support it since 4.2.3
-
Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
Construct anRestAbstractHttpMessageConverter
with no supported media types.protected
RestAbstractHttpMessageConverter
(org.springframework.http.MediaType supportedMediaType) Construct anRestAbstractHttpMessageConverter
with one supported media type. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDefaultHeaders
(org.springframework.http.HttpHeaders headers, T t, org.springframework.http.MediaType contentType) Add default headers to the output message.Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, readInternal, setDefaultCharset, setSupportedMediaTypes, supports, write, writeInternal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
RestAbstractHttpMessageConverter
protected RestAbstractHttpMessageConverter()Construct anRestAbstractHttpMessageConverter
with no supported media types.- See Also:
-
AbstractHttpMessageConverter.setSupportedMediaTypes(java.util.List<org.springframework.http.MediaType>)
-
RestAbstractHttpMessageConverter
protected RestAbstractHttpMessageConverter(org.springframework.http.MediaType supportedMediaType) Construct anRestAbstractHttpMessageConverter
with one supported media type.- Parameters:
supportedMediaType
- the supported media type
-
-
Method Details
-
addDefaultHeaders
protected void addDefaultHeaders(org.springframework.http.HttpHeaders headers, T t, org.springframework.http.MediaType contentType) throws IOException Add default headers to the output message. This implementation delegates toAbstractHttpMessageConverter.getDefaultContentType(Object)
if a content type was not provided, callsAbstractHttpMessageConverter.getContentLength(T, org.springframework.http.MediaType)
, and sets the corresponding headers- Overrides:
addDefaultHeaders
in classorg.springframework.http.converter.AbstractHttpMessageConverter<T>
- Throws:
IOException
-