Class FileToByteArrayTransformer
java.lang.Object
org.springframework.integration.file.transformer.AbstractFilePayloadTransformer<byte[]>
org.springframework.integration.file.transformer.FileToByteArrayTransformer
- 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 FileToByteArrayTransformer extends AbstractFilePayloadTransformer<byte[]>
A payload transformer that copies a File's contents to a byte array.
-
Constructor Summary
Constructors Constructor Description FileToByteArrayTransformer() -
Method Summary
Modifier and Type Method Description protected byte[]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
-
FileToByteArrayTransformer
public FileToByteArrayTransformer()
-
-
Method Details
-
transformFile
protected final byte[] transformFile(java.io.File file) throws java.io.IOExceptionDescription copied from class:AbstractFilePayloadTransformerSubclasses must implement this method to transform the File contents.- Specified by:
transformFilein classAbstractFilePayloadTransformer<byte[]>- Parameters:
file- The file.- Returns:
- The result of the transformation.
- Throws:
java.io.IOException- Any IOException.
-