[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

Example 1 Doing lots of FTP things.

Property Detail

commands

Configured ByELEMENT
AccessWRITE_ONLY
RequiredNo.

A List of the FTP commands.

host

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

The FTP server.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of this Job.

passive

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to false.

True if the connection is passive.

password

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes, unless user is anonymous.

The password to connect to the FTP server with.

port

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The Port.

result

AccessREAD_ONLY

username

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

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