public class FtpClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭FTP客户端
|
boolean |
downLoadFile(org.apache.commons.net.ftp.FTPFile ftpFile,
String localPath)
递归下载文件
|
boolean |
downLoadFile(String remotePath,
String localPath)
下载
|
String |
getMaxFileName(String remotePath)
获得目录下最大文件名
|
static void |
main(String[] args) |
void |
open()
FPT登录
|
void |
setProperties(Map<String,String> properties)
连接参数
|
void |
setProperties(Properties properties)
连接参数
|
boolean |
uploadFile(String remotePath,
String localPath)
上传
|
boolean |
uploadFiles(File localeFile,
String remotePath)
递归上传文件
|
public FtpClient()
public FtpClient(String host, int port, String username, String password) throws FtpException
host - IPport - 端口username - 用户名password - 密码FtpException - epublic void open()
public void close()
throws FtpException
FtpException - epublic boolean uploadFile(String remotePath, String localPath) throws FtpException
remotePath - 上传目录localPath - 本地目录FtpException - epublic boolean uploadFiles(File localeFile, String remotePath) throws FtpException
localeFile - 本地文件/目录remotePath - 上传目录FtpException - epublic boolean downLoadFile(String remotePath, String localPath) throws FtpException
remotePath - 下载目录localPath - 本地目录FtpException - epublic boolean downLoadFile(org.apache.commons.net.ftp.FTPFile ftpFile,
String localPath)
ftpFile - 下载文件/目录localPath - 本地目录public void setProperties(Properties properties)
properties - Copyright © 2017. All rights reserved.