[Index]
net:ftp
Connect to an FTP server and run a set of FTP commands.
Property Summary
| commands |
A List of the FTP commands. |
| host |
The FTP server. |
| name |
The name of this Job. |
| passive |
True if the connection is passive. |
| password |
The password to connect to the FTP server with. |
| port |
The Port. |
| result |
|
| username |
The user name to connect to the FTP server with. |
Example Summary
Property Detail
commands
| Configured By | ELEMENT |
| Access | WRITE_ONLY |
| Required | No. |
A List of the FTP commands.
host
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | Yes. |
The FTP server.
name
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The name of this Job.
passive
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No, defaults to false. |
True if the connection is passive.
password
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | Yes, unless user is anonymous. |
The password to connect to the FTP server with.
port
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The Port.
result
username
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | Yes. |
The user name to connect to the FTP server with.
Examples
Example 1
Doing lots of FTP things.
<oddjob id="this" xmlns:net="http://rgordon.co.uk/oddjob/net">
<job>
<net:ftp host="localhost" port="${ftp.port}" username="admin" password="admin">
<commands>
<list>
<values>
<identify id="pwd">
<value>
<net:ftp-pwd/>
</value>
</identify>
<net:ftp-mk-dir path="stuff"/>
<net:ftp-cd path="stuff"/>
<identify id="list1">
<value>
<net:ftp-list/>
</value>
</identify>
<net:ftp-ascii/>
<net:ftp-put remote="stuff.txt">
<file>
<file file="${this.args[0]}"/>
</file>
</net:ftp-put>
<identify id="list2">
<value>
<net:ftp-list/>
</value>
</identify>
<net:ftp-rename from="stuff.txt" to="things.txt"/>
<net:ftp-get remote="things.txt">
<file>
<file file="${this.args[1]}"/>
</file>
</net:ftp-get>
<net:ftp-delete path="things.txt"/>
<net:ftp-bin/>
<net:ftp-cd/>
<net:ftp-rm-dir path="stuff"/>
</values>
</list>
</commands>
</net:ftp>
</job>
</oddjob>
(c) R Gordon Ltd 2005 - Present