Class 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 of ResourceRegionHttpMessageConverter that checks if the resource implement RangeAwareResource. If it does, it calls RangeAwareResource.getInputStream(long, long) to get the region(s) to write.
    Author:
    avasquez
    • Field Summary

      • Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

        logger
    • 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
      • Methods inherited from interface org.springframework.http.converter.HttpMessageConverter

        getSupportedMediaTypes, getSupportedMediaTypes, read, write
    • Constructor Detail

      • RangeAwareResourceRegionHttpMessageConverter

        public RangeAwareResourceRegionHttpMessageConverter()
    • 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 class org.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 class org.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