I have been trying to get A VFS SFTP Move ActionAfterProcess to work in
Windows. I have tried many combinations of syntax for this, without luck. I
assume the Mediator is attempting to do:

rename file.edi /home/kimTest/upload/archive/file.edi

after the actual SFTP "get" to do the "MOVE"

Using a manual SFTP client the above command works fine, so the SFTP server
and permisison are OK.

I would have thought the existing SFTP session would still be valid, for the
MOVE, so its really not clear what the syntax of the command should be ?  I
tried 8 examples, see below. Test 1 result is strange. The last uncommented
Test 8 below gives following message in log:

2009-04-11 10:22:13,703 [-] [vfs-Worker-1] DEBUG VFSTransportListener Moving
to file
:sftp://username:[email protected]:22/home/kimTest/upload/archive\test1.edi
2009-04-11 10:22:15,078 [-] [vfs-Worker-1] DEBUG VFSTransportListener
Matching file :archive

So it appears to have worked but there is no file in the /archive directory
and the original file is still there, UN-MOVED. Just wondering if the
"/home/kimTest/upload/archive\test1.edi" path suggests a bug in windows
version of this code, the "\" ?

In all cases the file is SFTPed to local directory OK. I am not sure what am
I doing wrong; what combination have I missed, what should the correct
syntax be ?


<definitions xmlns="http://ws.apache.org/ns/synapse";>
  <proxy name="DoStuff" transports="vfs">
    <parameter
name="transport.vfs.FileURI">vfs:sftp://username:[email protected]:22/home/kimTest/upload?vfs.passive=true</parameter>
    <parameter name="transport.vfs.ContentType">text/plain</parameter>
    <parameter name="transport.vfs.FileNamePattern">.*\.edi</parameter>
    <parameter name="transport.PollInterval">5</parameter>
    <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>

    <!-- Test 1 : Below Destroys by Writing over the directory archive with
a file called archive. Data file is lost & Directory is Lost .   
    <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp://username:[email protected]:22/home/kimTest/upload/archive?vfs.passive=true</parameter>
  -->  

    <!-- Test 2 : Below does not MOVE the file archive. Synapse Error could
not MOVE file  
    <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp://username:[email protected]:22/home/kimTest/upload/archive/</parameter>
   --> 
    
    <!--  test 3 : Below Destroys by Writing over the directory archive as a
file called archive. Data file is lost. 
    <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp://username:[email protected]:22/home/kimTest/upload/archive/?vfs.passive=true</parameter>
     -->

    <!-- Test 4 : Assume we still have a session; Data file stays on server
but is not moved to archive. -->   
    <!-- Synapse Error: Error resolving directory to move after processing 
    <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp:///home/kimTest/upload/archive</parameter>
    -->
  
    <!-- Test 5 : Error resolving directory to move after processing   
    <parameter
name="transport.vfs.MoveAfterProcess">/home/kimTest/upload/archive</parameter>
    -->

       <!-- Test 6 : Error resolving directory to move after processing     
       <parameter
name="transport.vfs.MoveAfterProcess">/home/kimTest/upload/archive/</parameter>
       -->

     <!-- Test 7 : Could not connect to server     
             <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp://sftp.server.com:22/home/kimTest/upload/archive</parameter>
     --> 

     <!-- Test 8 : Appears to work, no errors, but no file in Archive, file
still in its place -->   
             <parameter
name="transport.vfs.MoveAfterProcess">vfs:sftp://username:[email protected]:22/home/kimTest/upload/archive</parameter>
 
    <target>
      <inSequence>
        <property name="transport.vfs.ReplyFileName"
expression="$trp:FILE_NAME" scope="transport"/>
        <send>
          <endpoint>
            <address uri="vfs:file:///C:/test"/>
          </endpoint>
        </send>
      </inSequence>
      <outSequence>
        <drop/>
      </outSequence>
    </target>
  </proxy>
</definitions>


NOTE I commented out the server name, password etc so may have introduced an
unrelated typo in this Message.

Thanks





-- 
View this message in context: 
http://www.nabble.com/Can%27t-get-VFS-SFTP-MOVE-to-work-on-Windows-tp22996841p22996841.html
Sent from the Synapse - User mailing list archive at Nabble.com.

Reply via email to