added rmi.xml
This commit is contained in:
@@ -13,33 +13,23 @@
|
||||
There is a namespace that enables elements that define channel
|
||||
adapters dedicated to files and support for transformers that
|
||||
transform files into strings or byte arrays.
|
||||
</para>
|
||||
</para>
|
||||
<para>
|
||||
This section will explain the workings of<classname>PollableFileSource</classname>,
|
||||
<classname>FileWritingMessageConsumer</classname> and how to configure them as
|
||||
<emphasis>beans</emphasis>. Also the support for dealing with files through file specific
|
||||
implementations of <interfacename>Transformer</interfacename> will be discussed. Finally
|
||||
the file specific namespace will be explained.
|
||||
This section will explain the workings of <classname>PollableFileSource</classname>, <classname>FileWritingMessageConsumer</classname> and how to configure them as <emphasis>beans</emphasis>. Also the support for dealing with files through file specific implementations of <interfacename>Transformer</interfacename> will be discussed. Finally the file specific namespace will be explained.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="file-reading">
|
||||
<title>Reading Files</title>
|
||||
<para>
|
||||
A
|
||||
<classname>PollableFileSource</classname>
|
||||
can be used to consume files from the filesystem. This is an
|
||||
implementation of
|
||||
<interfacename>PollableSource</interfacename>
|
||||
that creates messages from a file system directory.
|
||||
A <classname>PollableFileSource</classname> can be used to consume files from the filesystem. This is an implementation of <interfacename>PollableSource</interfacename> that creates messages from a file system directory.
|
||||
<programlisting language="xml"><![CDATA[<bean id="pollableFileSource" class="org.springframework.integration.file.PollableFileSource"
|
||||
p:inputDirectory="file:${input.directory.property}"/>]]></programlisting>
|
||||
</para>
|
||||
<para>
|
||||
To prevent creating messages for certain files, you may supply a
|
||||
{@link FileListFilter}. By default, an
|
||||
<classname>AcceptOnceFileListFilter
|
||||
</classname>
|
||||
<classname>AcceptOnceFileListFilter</classname>
|
||||
is used. This filter ensures files are picked up only once from the
|
||||
directory.
|
||||
<programlisting language="xml"><![CDATA[<bean id="pollableFileSource" class="org.springframework.integration.file.PollableFileSource"
|
||||
@@ -90,16 +80,14 @@
|
||||
</beans>]]></programlisting>
|
||||
Within this namespace you can reduce the PollableFileSource and wrap
|
||||
it in a InboundChannelAdapter like this:
|
||||
<programlisting language="xml"><![CDATA[ <file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"/> (1)
|
||||
<file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"
|
||||
filter="customFilterBean" /> (2)
|
||||
<file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"
|
||||
filename-pattern="^test.*$" /> (3)
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting language="xml"><![CDATA[<file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"/> (1)
|
||||
<file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"
|
||||
filter="customFilterBean" /> (2)
|
||||
<file:inbound-channel-adapter id="filesIn"
|
||||
directory="file:${input.directory.property}"
|
||||
filename-pattern="^test.*$" /> (3)]]></programlisting>
|
||||
Where (1) is relying on the default filter that just prevents
|
||||
duplication, (2) is using a custom filter and (3) is using the
|
||||
<emphasis>filename-pattern</emphasis>
|
||||
@@ -133,8 +121,7 @@
|
||||
To make things easier you can configure the
|
||||
FileWritingMessageConsumer as part of an outbound channel adapter
|
||||
using the namespace.
|
||||
<programlisting language="xml"><![CDATA[ <file:outbound-channel-adapter id="filesOut" directory="file:${input.directory.property}"/>
|
||||
]]></programlisting>
|
||||
<programlisting language="xml"><![CDATA[ <file:outbound-channel-adapter id="filesOut" directory="file:${input.directory.property}"/>]]></programlisting>
|
||||
</para>
|
||||
<para>
|
||||
If you have more elaborate requirements to the payload to file
|
||||
@@ -177,7 +164,7 @@
|
||||
<para>
|
||||
To configure File specific transformers you can use the appropriate
|
||||
elements from the file namespace.
|
||||
<programlisting language="xml"><![CDATA[ <file-to-bytes-transformer input-channel="intput" output-channel="output" delete-files="true"/>]]></programlisting>
|
||||
<programlisting language="xml"><![CDATA[<file-to-bytes-transformer input-channel="intput" output-channel="output" delete-files="true"/>]]></programlisting>
|
||||
The
|
||||
<emphasis>delete-files</emphasis>
|
||||
option signals the transformer to delete the File after the
|
||||
|
||||
Reference in New Issue
Block a user