Package org.kissweb
Class FTP
java.lang.Object
org.kissweb.FTP
- All Implemented Interfaces:
AutoCloseable
Transfer files to or from a remote FTP server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChange directory on remote system.voidclose()Close the connection.voidTransfer a file from the remote server to the local machine.static voidvoidTransfer a file to a remote system.voidTransfer a local file to the remote system.
-
Constructor Details
-
FTP
Form a new FTP connection. This actually logs into the system.- Parameters:
url-user-pw-- Throws:
IOExceptionException
-
FTP
Form a new FTP connection. This actually logs into the system.- Parameters:
url-port-user-pw-- Throws:
IOExceptionException
-
-
Method Details
-
cd
Change directory on remote system.- Parameters:
dir-- Throws:
Exception
-
put
Transfer a local file to the remote system.- Parameters:
localFileName-remoteFileName-- Throws:
Exception
-
put
Transfer a file to a remote system.- Parameters:
fileName- same file name on both systems- Throws:
Exception
-
get
Transfer a file from the remote server to the local machine.- Parameters:
remoteFileName-localFileName-- Throws:
Exception
-
close
Close the connection.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
main
- Throws:
Exception
-