Class Files
java.lang.Object
org.springframework.integration.file.dsl.Files
The Spring Integration File components Factory.
- Since:
- 5.0
- Author:
- Artem Bilan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioninboundAdapter
(File directory) Create aFileInboundChannelAdapterSpec
builder for theFileReadingMessageSource
.inboundAdapter
(File directory, Comparator<File> receptionOrderComparator) Create aFileInboundChannelAdapterSpec
builder for theFileReadingMessageSource
.outboundAdapter
(File destinationDirectory) Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.outboundAdapter
(String directoryExpression) Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.static <P> FileWritingMessageHandlerSpec
outboundAdapter
(Function<Message<P>, ?> directoryFunction) Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.outboundAdapter
(Expression directoryExpression) Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.outboundGateway
(File destinationDirectory) Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.outboundGateway
(String directoryExpression) Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.static <P> FileWritingMessageHandlerSpec
outboundGateway
(Function<Message<P>, ?> directoryFunction) Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.outboundGateway
(Expression directoryExpression) Create aFileWritingMessageHandlerSpec
based on the providedExpression
for directory.static FileSplitterSpec
splitter()
TheFileSplitterSpec
builder factory method with default arguments.static FileSplitterSpec
splitter
(boolean iterator) TheFileSplitterSpec
builder factory method withiterator
flag specified.static FileSplitterSpec
splitter
(boolean iterator, boolean markers) static TailAdapterSpec
tailAdapter
(File file) Create aTailAdapterSpec
builder for theFileTailingMessageProducerSupport
.static FileToByteArrayTransformer
Create aFileToByteArrayTransformer
instance.static FileToByteArrayTransformer
toByteArrayTransformer
(boolean deleteFiles) Create aFileToByteArrayTransformer
instance.static FileToStringTransformer
Create aFileToStringTransformer
instance with defaultcharset
and no delete files afterwards.static FileToStringTransformer
toStringTransformer
(boolean deleteFiles) Create aFileToStringTransformer
instance with defaultcharset
and with delete files flag.static FileToStringTransformer
toStringTransformer
(String charset) Create aFileToStringTransformer
instance with providedcharset
and no delete files afterwards.static FileToStringTransformer
toStringTransformer
(String charset, boolean deleteFiles) Create aFileToStringTransformer
instance with providedcharset
and delete files flag.
-
Constructor Details
-
Files
public Files()
-
-
Method Details
-
inboundAdapter
Create aFileInboundChannelAdapterSpec
builder for theFileReadingMessageSource
.- Parameters:
directory
- the directory to scan files.- Returns:
- the
FileInboundChannelAdapterSpec
instance.
-
inboundAdapter
public static FileInboundChannelAdapterSpec inboundAdapter(File directory, Comparator<File> receptionOrderComparator) Create aFileInboundChannelAdapterSpec
builder for theFileReadingMessageSource
.- Parameters:
directory
- the directory to scan files.receptionOrderComparator
- theComparator
for ordering file objects.- Returns:
- the
FileInboundChannelAdapterSpec
instance.
-
outboundAdapter
Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.- Parameters:
destinationDirectory
- the target directory to write files.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundAdapter
Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.- Parameters:
directoryExpression
- the SpEL expression to evaluate target directory for writing files.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundAdapter
Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.- Parameters:
directoryExpression
- an expression to evaluate the target directory.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundAdapter
public static <P> FileWritingMessageHandlerSpec outboundAdapter(Function<Message<P>, ?> directoryFunction) Create aFileWritingMessageHandlerSpec
builder for the one-wayFileWritingMessageHandler
.- Type Parameters:
P
- the payload type.- Parameters:
directoryFunction
- theFunction
to evaluate the target directory at runtime.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundGateway
Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.- Parameters:
destinationDirectory
- the target directory to write files.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundGateway
Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.- Parameters:
directoryExpression
- the SpEL expression to evaluate target directory for writing files.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
outboundGateway
Create aFileWritingMessageHandlerSpec
based on the providedExpression
for directory.- Parameters:
directoryExpression
- an expression to evaluate the target directory.- Returns:
- the FileWritingMessageHandlerSpec instance.
-
outboundGateway
public static <P> FileWritingMessageHandlerSpec outboundGateway(Function<Message<P>, ?> directoryFunction) Create aFileWritingMessageHandlerSpec
builder for the gatewayFileWritingMessageHandler
.- Type Parameters:
P
- the payload type.- Parameters:
directoryFunction
- theFunction
to evaluate the target directory at runtime.- Returns:
- the
FileWritingMessageHandlerSpec
instance.
-
tailAdapter
Create aTailAdapterSpec
builder for theFileTailingMessageProducerSupport
.- Parameters:
file
- the file to tail.- Returns:
- the
TailAdapterSpec
instance.
-
splitter
TheFileSplitterSpec
builder factory method with default arguments.- Returns:
- the
FileSplitterSpec
builder.
-
splitter
TheFileSplitterSpec
builder factory method withiterator
flag specified.- Parameters:
iterator
- theboolean
flag to specify theiterator
mode or not.- Returns:
- the
FileSplitterSpec
builder.
-
splitter
- Parameters:
iterator
- theboolean
flag to specify theiterator
mode or not.markers
- true to emit start of file/end of file marker messages before/after the data.- Returns:
- the
FileSplitterSpec
builder.
-
toStringTransformer
Create aFileToStringTransformer
instance with defaultcharset
and no delete files afterwards.- Returns:
- the
FileToStringTransformer
.
-
toStringTransformer
Create aFileToStringTransformer
instance with defaultcharset
and with delete files flag.- Parameters:
deleteFiles
- true to delete the file.- Returns:
- the
FileToStringTransformer
.
-
toStringTransformer
Create aFileToStringTransformer
instance with providedcharset
and no delete files afterwards.- Parameters:
charset
- The charset.- Returns:
- the
FileToStringTransformer
.
-
toStringTransformer
Create aFileToStringTransformer
instance with providedcharset
and delete files flag.- Parameters:
charset
- The charset.deleteFiles
- true to delete the file.- Returns:
- the
FileToStringTransformer
.
-
toByteArrayTransformer
Create aFileToByteArrayTransformer
instance.- Returns:
- the
FileToByteArrayTransformer
.
-
toByteArrayTransformer
Create aFileToByteArrayTransformer
instance.- Parameters:
deleteFiles
- specify whether to delete the File after transformation. Default is false.- Returns:
- the
FileToByteArrayTransformer
.
-