Package com.nt.udc.ndk.util
Interface FtpSupportIntf
- All Known Implementing Classes:
FtpSession
,SftpSession
public interface FtpSupportIntf
Use this interface in classes that you would like to support,
or contain support for, FTP.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Changes the current working directory.boolean
Remove a file from the remote host.void
Disconnects from the remote FTP serverboolean
Copy the remote file to the local file.getHost()
Returns the remote hostgetLogin()
Returns the login nameReturns the login passwordgetTimestamp
(String remotePath) Returns the timestamp of the given remote path.String[]
listDirectories
(String remotePath) Returns the list of directories in the given remote directory.String[]
Returns the list of files in the current remote directory.String[]
Returns the list of files in the given remote directory.boolean
Logs into the remote host, using the given ip address, login name and password.boolean
logout()
Logs out of the remote FTP serverboolean
Copy the local file to the remote file.pwd()
Returns the present working directory.boolean
void
Sets the transfer file type to ASCIIvoid
Sets the transfer file type to BINARY
-
Method Details
-
login
Logs into the remote host, using the given ip address, login name and password.- Parameters:
ip
- remote ip addresslogin
- login namepassword
- login password- Returns:
- true, if login is successful. false, otherwise.
- Throws:
IOException
-
logout
Logs out of the remote FTP server- Throws:
IOException
-
disconnect
Disconnects from the remote FTP server- Throws:
IOException
-
setBinaryFileType
void setBinaryFileType()Sets the transfer file type to BINARY -
setAsciiFileType
void setAsciiFileType()Sets the transfer file type to ASCII -
get
Copy the remote file to the local file. One must set the appropriate file type before the get; the default is binary mode.- Parameters:
localFile
- Local file name.remoteFile
- Remote file name.- Returns:
- true, if get was successful.
- Throws:
IOException
-
put
Copy the local file to the remote file. One must set the appropriate file type before the get; the default is binary mode.- Parameters:
localFile
- Local file name.remoteFile
- Remote file name.- Returns:
- true, if get was successful.
- Throws:
IOException
-
delete
Remove a file from the remote host.- Parameters:
fileName
- remote file pathname- Returns:
- true, if delete was successful
- Throws:
IOException
-
pwd
Returns the present working directory.- Returns:
- present working directory
- Throws:
IOException
-
cd
Changes the current working directory.- Parameters:
remotePath
- new remote directory- Returns:
- present working directory
- Throws:
IOException
-
listFiles
Returns the list of files in the current remote directory.- Returns:
- list of files
- Throws:
IOException
-
listFiles
Returns the list of files in the given remote directory.- Parameters:
remotePath
- remote directory to list- Returns:
- list of files
- Throws:
IOException
-
listDirectories
Returns the list of directories in the given remote directory.- Parameters:
remotePath
- remote directory to list- Returns:
- list of directories
- Throws:
IOException
-
getTimestamp
Returns the timestamp of the given remote path.- Parameters:
remotePath
- remote path for which to get timestamp- Returns:
- timestamp of the remote path
- Throws:
IOException
-
rename
- Throws:
IOException
-
getPassword
String getPassword()Returns the login password- Returns:
- login password
-
getHost
String getHost()Returns the remote host- Returns:
- remote host name
-
getLogin
String getLogin()Returns the login name- Returns:
- login name
-