3. Calling the
connect() method, which connects to the server and logs in.
ftp.connect();
4. Logging out and closing the connection.
ftp.disconnect();
The connect() call will return when successfully connected and logged in, or throw an exception if it fails to
connect or log in.
Note that the automatic login can be disabled using the advanced settings,
which must be obtained via getAdvancedFTPSettings().
ftp.getAdvancedFTPSettings().setAutoLogin(false);
If autologin is disabled,
manualLogin()
must be be used to log into the server after connect() has been called (and prior to any remote operations
being performed):