public abstract class Files extends Object
Constructor and Description |
---|
Files() |
Modifier and Type | Method and Description |
---|---|
static FileInboundChannelAdapterSpec |
inboundAdapter(File directory)
Create a
FileInboundChannelAdapterSpec builder for the FileReadingMessageSource . |
static FileInboundChannelAdapterSpec |
inboundAdapter(File directory,
Comparator<File> receptionOrderComparator)
Create a
FileInboundChannelAdapterSpec builder for the FileReadingMessageSource . |
static FileWritingMessageHandlerSpec |
outboundAdapter(Expression directoryExpression)
Create a
FileWritingMessageHandlerSpec builder for the one-way FileWritingMessageHandler . |
static FileWritingMessageHandlerSpec |
outboundAdapter(File destinationDirectory)
Create a
FileWritingMessageHandlerSpec builder for the one-way FileWritingMessageHandler . |
static <P> FileWritingMessageHandlerSpec |
outboundAdapter(java.util.function.Function<Message<P>,?> directoryFunction)
Create a
FileWritingMessageHandlerSpec builder for the one-way FileWritingMessageHandler . |
static FileWritingMessageHandlerSpec |
outboundAdapter(String directoryExpression)
Create a
FileWritingMessageHandlerSpec builder for the one-way FileWritingMessageHandler . |
static FileWritingMessageHandlerSpec |
outboundGateway(Expression directoryExpression)
Create a
FileWritingMessageHandlerSpec based on the provided Expression for directory. |
static FileWritingMessageHandlerSpec |
outboundGateway(File destinationDirectory)
Create a
FileWritingMessageHandlerSpec builder for the gateway FileWritingMessageHandler . |
static <P> FileWritingMessageHandlerSpec |
outboundGateway(java.util.function.Function<Message<P>,?> directoryFunction)
Create a
FileWritingMessageHandlerSpec builder for the gateway FileWritingMessageHandler . |
static FileWritingMessageHandlerSpec |
outboundGateway(String directoryExpression)
Create a
FileWritingMessageHandlerSpec builder for the gateway FileWritingMessageHandler . |
static FileSplitterSpec |
splitter()
The
FileSplitterSpec builder factory method with default arguments. |
static FileSplitterSpec |
splitter(boolean iterator)
The
FileSplitterSpec builder factory method with iterator flag specified. |
static FileSplitterSpec |
splitter(boolean iterator,
boolean markers)
|
static TailAdapterSpec |
tailAdapter(File file)
Create a
TailAdapterSpec builder for the FileTailingMessageProducerSupport . |
static FileToByteArrayTransformer |
toByteArrayTransformer()
Create a
FileToByteArrayTransformer instance. |
static FileToByteArrayTransformer |
toByteArrayTransformer(boolean deleteFiles)
Create a
FileToByteArrayTransformer instance. |
static FileToStringTransformer |
toStringTransformer()
Create a
FileToStringTransformer instance with default charset and no delete files afterwards. |
static FileToStringTransformer |
toStringTransformer(boolean deleteFiles)
Create a
FileToStringTransformer instance with default charset and with delete files flag. |
static FileToStringTransformer |
toStringTransformer(String charset)
Create a
FileToStringTransformer instance with provided charset and no delete files afterwards. |
static FileToStringTransformer |
toStringTransformer(String charset,
boolean deleteFiles)
Create a
FileToStringTransformer instance with provided charset and delete files flag. |
public static FileInboundChannelAdapterSpec inboundAdapter(File directory)
FileInboundChannelAdapterSpec
builder for the FileReadingMessageSource
.directory
- the directory to scan files.FileInboundChannelAdapterSpec
instance.public static FileInboundChannelAdapterSpec inboundAdapter(File directory, Comparator<File> receptionOrderComparator)
FileInboundChannelAdapterSpec
builder for the FileReadingMessageSource
.directory
- the directory to scan files.receptionOrderComparator
- the Comparator
for ordering file objects.FileInboundChannelAdapterSpec
instance.public static FileWritingMessageHandlerSpec outboundAdapter(File destinationDirectory)
FileWritingMessageHandlerSpec
builder for the one-way FileWritingMessageHandler
.destinationDirectory
- the target directory to write files.FileWritingMessageHandlerSpec
instance.public static FileWritingMessageHandlerSpec outboundAdapter(String directoryExpression)
FileWritingMessageHandlerSpec
builder for the one-way FileWritingMessageHandler
.directoryExpression
- the SpEL expression to evaluate target directory for writing files.FileWritingMessageHandlerSpec
instance.public static FileWritingMessageHandlerSpec outboundAdapter(Expression directoryExpression)
FileWritingMessageHandlerSpec
builder for the one-way FileWritingMessageHandler
.directoryExpression
- an expression to evaluate the target directory.FileWritingMessageHandlerSpec
instance.public static <P> FileWritingMessageHandlerSpec outboundAdapter(java.util.function.Function<Message<P>,?> directoryFunction)
FileWritingMessageHandlerSpec
builder for the one-way FileWritingMessageHandler
.P
- the payload type.directoryFunction
- the Function
to evaluate the target directory at runtime.FileWritingMessageHandlerSpec
instance.public static FileWritingMessageHandlerSpec outboundGateway(File destinationDirectory)
FileWritingMessageHandlerSpec
builder for the gateway FileWritingMessageHandler
.destinationDirectory
- the target directory to write files.FileWritingMessageHandlerSpec
instance.public static FileWritingMessageHandlerSpec outboundGateway(String directoryExpression)
FileWritingMessageHandlerSpec
builder for the gateway FileWritingMessageHandler
.directoryExpression
- the SpEL expression to evaluate target directory for writing files.FileWritingMessageHandlerSpec
instance.public static FileWritingMessageHandlerSpec outboundGateway(Expression directoryExpression)
FileWritingMessageHandlerSpec
based on the provided Expression
for directory.directoryExpression
- an expression to evaluate the target directory.public static <P> FileWritingMessageHandlerSpec outboundGateway(java.util.function.Function<Message<P>,?> directoryFunction)
FileWritingMessageHandlerSpec
builder for the gateway FileWritingMessageHandler
.P
- the payload type.directoryFunction
- the Function
to evaluate the target directory at runtime.FileWritingMessageHandlerSpec
instance.public static TailAdapterSpec tailAdapter(File file)
TailAdapterSpec
builder for the FileTailingMessageProducerSupport
.file
- the file to tail.TailAdapterSpec
instance.public static FileSplitterSpec splitter()
FileSplitterSpec
builder factory method with default arguments.FileSplitterSpec
builder.public static FileSplitterSpec splitter(boolean iterator)
FileSplitterSpec
builder factory method with iterator
flag specified.iterator
- the boolean
flag to specify the iterator
mode or not.FileSplitterSpec
builder.public static FileSplitterSpec splitter(boolean iterator, boolean markers)
iterator
- the boolean
flag to specify the iterator
mode or not.markers
- true to emit start of file/end of file marker messages before/after the data.FileSplitterSpec
builder.public static FileToStringTransformer toStringTransformer()
FileToStringTransformer
instance with default charset
and no delete files afterwards.FileToStringTransformer
.public static FileToStringTransformer toStringTransformer(boolean deleteFiles)
FileToStringTransformer
instance with default charset
and with delete files flag.deleteFiles
- true to delete the file.FileToStringTransformer
.public static FileToStringTransformer toStringTransformer(String charset)
FileToStringTransformer
instance with provided charset
and no delete files afterwards.charset
- The charset.FileToStringTransformer
.public static FileToStringTransformer toStringTransformer(String charset, boolean deleteFiles)
FileToStringTransformer
instance with provided charset
and delete files flag.charset
- The charset.deleteFiles
- true to delete the file.FileToStringTransformer
.public static FileToByteArrayTransformer toByteArrayTransformer()
FileToByteArrayTransformer
instance.FileToByteArrayTransformer
.public static FileToByteArrayTransformer toByteArrayTransformer(boolean deleteFiles)
FileToByteArrayTransformer
instance.deleteFiles
- specify whether to delete the File after transformation.
Default is false.FileToByteArrayTransformer
.