Class MultipartMixedHttpMessageConverter

  • All Implemented Interfaces:
    org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>

    public class MultipartMixedHttpMessageConverter
    extends java.lang.Object
    implements org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
    Custom HTTP message converter for Multipart mixed mode
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static byte[] MULTIPART_CHARS
      The pool of ASCII chars to be used for generating a multipart boundary.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addContentTypeHeader​(java.io.OutputStream os, byte[] changeset)  
      protected void addEncodingHeader​(java.io.OutputStream os)  
      boolean canRead​(java.lang.Class clazz, org.springframework.http.MediaType mediaType)  
      boolean canWrite​(java.lang.Class clazz, org.springframework.http.MediaType mediaType)  
      protected static byte[] generateMultipartBoundary()  
      protected org.springframework.http.HttpEntity<?> getHttpEntity​(java.lang.Object part)  
      java.util.List getSupportedMediaTypes()  
      org.springframework.util.MultiValueMap<java.lang.String,​?> read​(java.lang.Class val, org.springframework.http.HttpInputMessage inputMessage)  
      protected ODataError retrieveJsonError​(java.lang.String jsonToCheck)  
      void write​(org.springframework.util.MultiValueMap<java.lang.String,​?> values, org.springframework.http.MediaType mediaType, org.springframework.http.HttpOutputMessage outputMessage)  
      protected void writeBoundary​(java.io.OutputStream os, byte[] boundary)  
      protected static void writeEnd​(java.io.OutputStream os, byte[] changeset, byte[] boundary)  
      protected void writeMultipart​(org.springframework.util.MultiValueMap<java.lang.String,​java.lang.Object> parts, org.springframework.http.HttpOutputMessage outputMessage)  
      protected static void writeNewLine​(java.io.OutputStream os)  
      protected void writePart​(org.springframework.http.HttpEntity<?> partEntity, java.io.OutputStream os)  
      protected void writeParts​(java.io.OutputStream os, org.springframework.util.MultiValueMap<java.lang.String,​java.lang.Object> parts, byte[] changeset)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MULTIPART_CHARS

        protected static byte[] MULTIPART_CHARS
        The pool of ASCII chars to be used for generating a multipart boundary.
    • Constructor Detail

      • MultipartMixedHttpMessageConverter

        public MultipartMixedHttpMessageConverter()
    • Method Detail

      • write

        public void write​(org.springframework.util.MultiValueMap<java.lang.String,​?> values,
                          org.springframework.http.MediaType mediaType,
                          org.springframework.http.HttpOutputMessage outputMessage)
                   throws java.io.IOException,
                          org.springframework.http.converter.HttpMessageNotWritableException
        Specified by:
        write in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
        Throws:
        java.io.IOException
        org.springframework.http.converter.HttpMessageNotWritableException
      • writeMultipart

        protected void writeMultipart​(org.springframework.util.MultiValueMap<java.lang.String,​java.lang.Object> parts,
                                      org.springframework.http.HttpOutputMessage outputMessage)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeParts

        protected void writeParts​(java.io.OutputStream os,
                                  org.springframework.util.MultiValueMap<java.lang.String,​java.lang.Object> parts,
                                  byte[] changeset)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • addEncodingHeader

        protected void addEncodingHeader​(java.io.OutputStream os)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • addContentTypeHeader

        protected void addContentTypeHeader​(java.io.OutputStream os,
                                            byte[] changeset)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writePart

        protected void writePart​(org.springframework.http.HttpEntity<?> partEntity,
                                 java.io.OutputStream os)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • generateMultipartBoundary

        protected static byte[] generateMultipartBoundary()
      • getHttpEntity

        protected org.springframework.http.HttpEntity<?> getHttpEntity​(java.lang.Object part)
      • writeBoundary

        protected void writeBoundary​(java.io.OutputStream os,
                                     byte[] boundary)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEnd

        protected static void writeEnd​(java.io.OutputStream os,
                                       byte[] changeset,
                                       byte[] boundary)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeNewLine

        protected static void writeNewLine​(java.io.OutputStream os)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • canWrite

        public boolean canWrite​(java.lang.Class clazz,
                                org.springframework.http.MediaType mediaType)
        Specified by:
        canWrite in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
      • getSupportedMediaTypes

        public java.util.List getSupportedMediaTypes()
        Specified by:
        getSupportedMediaTypes in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
      • canRead

        public boolean canRead​(java.lang.Class clazz,
                               org.springframework.http.MediaType mediaType)
        Specified by:
        canRead in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
      • read

        public org.springframework.util.MultiValueMap<java.lang.String,​?> read​(java.lang.Class val,
                                                                                     org.springframework.http.HttpInputMessage inputMessage)
                                                                              throws java.io.IOException,
                                                                                     org.springframework.http.converter.HttpMessageNotReadableException
        Specified by:
        read in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,​?>>
        Throws:
        java.io.IOException
        org.springframework.http.converter.HttpMessageNotReadableException
      • retrieveJsonError

        protected ODataError retrieveJsonError​(java.lang.String jsonToCheck)