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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Change directory on remote system.void
close()
Close the connection.void
Transfer a file from the remote server to the local machine.static void
void
Transfer a file to a remote system.void
Transfer 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:
IOException
Exception
-
FTP
Form a new FTP connection. This actually logs into the system.- Parameters:
url
-port
-user
-pw
-- Throws:
IOException
Exception
-
-
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:
close
in interfaceAutoCloseable
- Throws:
Exception
-
main
- Throws:
Exception
-