Class RangeAwareResourceRegionHttpMessageConverter
- java.lang.Object
-
- org.springframework.http.converter.AbstractHttpMessageConverter<T>
-
- org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
-
- org.springframework.http.converter.ResourceRegionHttpMessageConverter
-
- org.craftercms.engine.util.spring.resources.RangeAwareResourceRegionHttpMessageConverter
-
- All Implemented Interfaces:
org.springframework.http.converter.GenericHttpMessageConverter<Object>
,org.springframework.http.converter.HttpMessageConverter<Object>
public class RangeAwareResourceRegionHttpMessageConverter extends org.springframework.http.converter.ResourceRegionHttpMessageConverter
Extension ofResourceRegionHttpMessageConverter
that checks if the resource implementRangeAwareResource
. If it does, it callsRangeAwareResource.getInputStream(long, long)
to get the region(s) to write.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description RangeAwareResourceRegionHttpMessageConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
print(OutputStream os, String buf)
protected void
println(OutputStream os)
protected void
writeInternal(Object object, Type type, org.springframework.http.HttpOutputMessage outputMessage)
protected void
writeResourceRegion(org.springframework.core.io.support.ResourceRegion region, org.springframework.http.HttpOutputMessage outputMessage)
protected void
writeResourceRegionCollection(Collection<org.springframework.core.io.support.ResourceRegion> resourceRegions, org.springframework.http.HttpOutputMessage outputMessage)
-
Methods inherited from class org.springframework.http.converter.ResourceRegionHttpMessageConverter
canRead, canRead, canWrite, canWrite, getDefaultContentType, read, readInternal
-
Methods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConverter
supports, write, writeInternal
-
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canWrite, getContentLength, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
-
-
-
-
Method Detail
-
writeInternal
protected void writeInternal(Object object, Type type, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
- Overrides:
writeInternal
in classorg.springframework.http.converter.ResourceRegionHttpMessageConverter
- Throws:
IOException
org.springframework.http.converter.HttpMessageNotWritableException
-
writeResourceRegion
protected void writeResourceRegion(org.springframework.core.io.support.ResourceRegion region, org.springframework.http.HttpOutputMessage outputMessage) throws IOException
- Overrides:
writeResourceRegion
in classorg.springframework.http.converter.ResourceRegionHttpMessageConverter
- Throws:
IOException
-
writeResourceRegionCollection
protected void writeResourceRegionCollection(Collection<org.springframework.core.io.support.ResourceRegion> resourceRegions, org.springframework.http.HttpOutputMessage outputMessage) throws IOException
- Throws:
IOException
-
println
protected void println(OutputStream os) throws IOException
- Throws:
IOException
-
print
protected void print(OutputStream os, String buf) throws IOException
- Throws:
IOException
-
-