Class SimpleMultipartFileReader

java.lang.Object
org.springframework.integration.http.multipart.SimpleMultipartFileReader
All Implemented Interfaces:
MultipartFileReader<java.lang.Object>

public class SimpleMultipartFileReader
extends java.lang.Object
implements MultipartFileReader<java.lang.Object>
MultipartFileReader implementation that does not maintain metadata from the original MultipartFile instance. Instead this simply reads the file content directly as either a String or byte array depending on the Content-Type.
Since:
2.0
  • Constructor Summary

    Constructors 
    Constructor Description
    SimpleMultipartFileReader()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object readMultipartFile​(org.springframework.web.multipart.MultipartFile multipartFile)
    Read MultipartFile content.
    void setDefaultMultipartCharset​(java.lang.String defaultCharset)
    Specify the default charset name to use when converting multipart file content into Strings if the multipart itself does not provide a charset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setDefaultMultipartCharset

      public void setDefaultMultipartCharset​(java.lang.String defaultCharset)
      Specify the default charset name to use when converting multipart file content into Strings if the multipart itself does not provide a charset.
      Parameters:
      defaultCharset - The default charset.
    • readMultipartFile

      public java.lang.Object readMultipartFile​(org.springframework.web.multipart.MultipartFile multipartFile) throws java.io.IOException
      Description copied from interface: MultipartFileReader
      Read MultipartFile content.
      Specified by:
      readMultipartFile in interface MultipartFileReader<java.lang.Object>
      Parameters:
      multipartFile - The multipart file.
      Returns:
      The result of reading the file.
      Throws:
      java.io.IOException - Any IOException.