public class FTPClient extends Object
Constructor and Description |
---|
FTPClient(String aHost,
String aUser,
String aPassword)
Constructor that takes the three parameters necessary for the
FTP connection.
|
Modifier and Type | Method and Description |
---|---|
void |
sendBinaryFile(String aFilename)
This method sends a binary file to the default FTP location on the server.
|
void |
sendFiles(String[] aFilenames,
boolean aBinaryMode)
This method sends a group of files to the default FTP location on the server.
|
void |
sendFiles(String[] aFilenames,
boolean[] aBinaryMode)
This method sends a group of files to the default FTP location on the server.
|
void |
sendTextFile(String aFilename)
This method sends a text file to the default FTP location on the server.
|
void |
testFTPConnection()
This method can be used to test the connection with the FTP server.
|
public FTPClient(String aHost, String aUser, String aPassword)
aHost
- String with the hostname of the FTP server to connect to.aUser
- String with the username to connect with.aPassword
- String with the password for the specified user.public void sendTextFile(String aFilename) throws IOException
aFilename
- String with the filename to send.IOException
- when retrieving the file fails, or sending the file
failed.public void sendBinaryFile(String aFilename) throws IOException
aFilename
- String with the filename to send.IOException
- when retrieving the file fails, or sending the file
failed.public void sendFiles(String[] aFilenames, boolean[] aBinaryMode) throws IOException
aFilenames
- String[] with the filenames of the files to send.aBinaryMode
- boolean[] to indicate whether the files are to be send in binary
transfer mode ('true') or text mode ('false'). Note that this
setting applies to all files in the group.IOException
- when retrieving the file fails, or sending the file
failed.public void sendFiles(String[] aFilenames, boolean aBinaryMode) throws IOException
aFilenames
- String[] with the filenames of the files to send.aBinaryMode
- boolean to indicate whether the files are to be send in binary
transfer mode ('true') or text mode ('false'). Note that this
setting applies to all files in the group.IOException
- when retrieving the file fails, or sending the file
failed.public void testFTPConnection() throws IOException
IOException
- whenever a connection could not be established.Copyright © 2016. All rights reserved.