Class AbstractFilePayloadTransformer<T>
java.lang.Object
org.springframework.integration.file.transformer.AbstractFilePayloadTransformer<T>
- Type Parameters:
T
- the expected payload type.
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,GenericTransformer<Message<?>,
,Message<?>> Transformer
- Direct Known Subclasses:
FileToByteArrayTransformer
,FileToStringTransformer
public abstract class AbstractFilePayloadTransformer<T>
extends Object
implements Transformer, BeanFactoryAware
Base class for transformers that convert a File payload.
- Author:
- Mark Fisher, Artem Bilan
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected MessageBuilderFactory
void
setBeanFactory
(BeanFactory beanFactory) void
setDeleteFiles
(boolean deleteFiles) Specify whether to delete the File after transformation.final Message<?>
protected abstract T
transformFile
(File file) Subclasses must implement this method to transform the File contents.
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractFilePayloadTransformer
public AbstractFilePayloadTransformer()
-
-
Method Details
-
setDeleteFiles
public void setDeleteFiles(boolean deleteFiles) Specify whether to delete the File after transformation. Default isfalse
.- Parameters:
deleteFiles
- true to delete the file.
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getMessageBuilderFactory
-
transform
- Specified by:
transform
in interfaceGenericTransformer<Message<?>,
Message<?>> - Specified by:
transform
in interfaceTransformer
-
transformFile
Subclasses must implement this method to transform the File contents.- Parameters:
file
- The file.- Returns:
- The result of the transformation.
- Throws:
IOException
- Any IOException.
-