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.
-
Field Summary
Fields inherited from class org.springframework.integration.file.transformer.AbstractFilePayloadTransformer
logger
-
Constructor Summary
Constructors Constructor Description FileToStringTransformer()
-
Method Summary
Modifier and Type Method Description void
setCharset(java.lang.String charset)
Set the charset name to use when copying the File to a String.protected java.lang.String
transformFile(java.io.File file)
Subclasses must implement this method to transform the File contents.Methods inherited from class org.springframework.integration.file.transformer.AbstractFilePayloadTransformer
getMessageBuilderFactory, setBeanFactory, setDeleteFiles, transform
-
Constructor Details
-
FileToStringTransformer
public FileToStringTransformer()
-
-
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.IOExceptionDescription copied from class:AbstractFilePayloadTransformer
Subclasses must implement this method to transform the File contents.- Specified by:
transformFile
in classAbstractFilePayloadTransformer<java.lang.String>
- Parameters:
file
- The file.- Returns:
- The result of the transformation.
- Throws:
java.io.IOException
- Any IOException.
-