On 3/16/07, avi-s <[EMAIL PROTECTED]> wrote:

Is there an easy way to send a file using FTP and than rename or move it to
another location (on the FTP server using FTP command) without customising
the provided FTP transport component?

This usage is a common techniques applied when FTP is used for file based
message exchange between two applications.

The sending application send the file with a temporary name or place it in a
temporary folder and when the 'SEND' operation is completed it rename or
move the file (using FTP command) to the common area where the receiving
application is expecting the file. This is done to avoid the receiving
application attempting to read the file prematurely (before it was
completely transferred).

In the servicemix-ftp JBI component and its FtpSenderEndpoint class,
there is a uniqueFileName variable that can be used for this - at
least I think it is used for this purpose.

In looking at the FtpSenderEndpoint.processInOnly() method, it calls
the Commons Net FTPClient.storeUniqueFileStream(uniqueFileName) method
which creates an output stream to create a file to store data on the
server.

If I'm wrong, I'm sure Guillaume will correct me ;-).

Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Reply via email to