Petals-BC-SFTP 1.2.x

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (4)

View Page History
* *mput:* Write the JBI message attachments it receives into files.
* *get:* Retrieve *Xml* file corresponding to a pattern, from a folder. Return it as message payload.
* *getAsAttachment:* Retrieve the first file corresponding to a pattern, from a folder. Return it as message's attachment.(XOP standard)
* *mGet:* Retrieve files corresponding to a pattern, from a folder. Return them as message's attachment.
* *del:* Delete one file.
* *dir:* List the content of a folder.

{info}Only xml file could be processed otherwise an error will be raised.{info}



h3. GetAsAttachment Operation

When the get operation is set on the incoming IN message, the component retrieve ONE file from the SFTP server and return it as an attachment.

The name of the file to retrieve is set in the XML IN content of the message.

The IN message looks like :
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<ver:getAsAttachment xmlns:ver="http://petals.ow2.org/components/sftp/version-1">
<ver:filename>file name to retrieve</ver:filename>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:getAsAttachment>
{code}
The OUT message returned to the consumer contains files, as attachments, and an XML message report :
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<tns:getAsAttachmentResponse xmlns:tns="http://petals.ow2.org/components/sftp/version-1">
<tns:attachment>
<tns:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test1.xml"/></tns:filename>
<tns:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test2.xml"/></tns:filename>
</tns:attachment>
</tns:getAsAttachmentResponse>
{code}
The service might return a Fault when an element in the request is missing or if the SFTP connection failed

The available exchange pattern is : *InOut*.



h3. MGet Operation

The available exchange pattern is : *InOut*.


h3. Del Operation

When the del operation is set on the incoming IN message, the component delete the remote file.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?><ver:del xmlns:ver="http://petals.ow2.org/components//version-3>
<ver:filename>?</ver:filename>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:del>
{code}
The service does not return a message.
The service might return an Error when an element in the request is missing or if the SFTP connection failed.
The available exchange pattern is : InOnly.

h2. Configuration