org.oddjob.net.ftp
Class FTPClientJob
java.lang.Object
org.oddjob.net.ftp.FTPClientJob
- All Implemented Interfaces:
- Serializable, Runnable, Stoppable
public class FTPClientJob
- extends Object
- implements Runnable, Stoppable, Serializable
Description
Connect to an FTP server and run a set of FTP commands.Example
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>
- See Also:
- Serialized Form
- Author:
- rob
FTPClientJob
public FTPClientJob()
run
public void run()
- Specified by:
run
in interface Runnable
stop
public void stop()
throws FailedToStopException
- Description copied from interface:
Stoppable
- Stop executing. This method should not return until the
Stoppable has actually stopped.
- Specified by:
stop
in interface Stoppable
- Throws:
FailedToStopException
getName
public String getName()
setName
public void setName(String name)
getHost
public String getHost()
setHost
public void setHost(String host)
getPort
public int getPort()
setPort
public void setPort(int port)
getUsername
public String getUsername()
setUsername
public void setUsername(String username)
getPassword
public String getPassword()
setPassword
public void setPassword(String password)
setCommands
public void setCommands(FTPCommand[] commands)
getResult
public int getResult()
toString
public String toString()
- Overrides:
toString
in class Object
isPassive
public boolean isPassive()
setPassive
public void setPassive(boolean passive)