Class RangeAwareResourceRegionHttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
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 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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    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, supportsRepeatableWrites

    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 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, getSupportedMediaTypes, read, write
  • Constructor Details

    • RangeAwareResourceRegionHttpMessageConverter

      public RangeAwareResourceRegionHttpMessageConverter()
  • Method Details

    • 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
    • println

      protected void println(OutputStream os) throws IOException
      Throws:
      IOException
    • print

      protected void print(OutputStream os, String buf) throws IOException
      Throws:
      IOException