Class FileToStringTransformer
java.lang.Object
org.springframework.integration.file.transformer.AbstractFilePayloadTransformer<String>
org.springframework.integration.file.transformer.FileToStringTransformer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,GenericTransformer<Message<?>,
,Message<?>> Transformer
A payload transformer that copies a File's contents to a String.
- Author:
- Mark Fisher, Gary Russell
-
Field Summary
Fields inherited from class org.springframework.integration.file.transformer.AbstractFilePayloadTransformer
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setCharset
(String charset) Set the charset name to use when copying the File to a String.protected final String
transformFile
(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
Set the charset name to use when copying the File to a String.- Parameters:
charset
- The charset.
-
transformFile
Description copied from class:AbstractFilePayloadTransformer
Subclasses must implement this method to transform the File contents.- Specified by:
transformFile
in classAbstractFilePayloadTransformer<String>
- Parameters:
file
- The file.- Returns:
- The result of the transformation.
- Throws:
IOException
- Any IOException.
-