Class FileToStringTransformer

java.lang.Object
org.springframework.integration.file.transformer.AbstractFilePayloadTransformer<java.lang.String>
org.springframework.integration.file.transformer.FileToStringTransformer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.integration.transformer.GenericTransformer<org.springframework.messaging.Message<?>,​org.springframework.messaging.Message<?>>, org.springframework.integration.transformer.Transformer

public class FileToStringTransformer
extends AbstractFilePayloadTransformer<java.lang.String>
A payload transformer that copies a File's contents to a String.
  • Constructor Details

  • Method Details

    • setCharset

      public void setCharset​(java.lang.String charset)
      Set the charset name to use when copying the File to a String.
      Parameters:
      charset - The charset.
    • transformFile

      protected final java.lang.String transformFile​(java.io.File file) throws java.io.IOException
      Description copied from class: AbstractFilePayloadTransformer
      Subclasses must implement this method to transform the File contents.
      Specified by:
      transformFile in class AbstractFilePayloadTransformer<java.lang.String>
      Parameters:
      file - The file.
      Returns:
      The result of the transformation.
      Throws:
      java.io.IOException - Any IOException.