public class FtpUtilClient extends Object
| 构造器和说明 |
|---|
FtpUtilClient() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
downloadFile(String host,
int port,
String username,
String password,
String remotePath,
String fileName,
String localPath)
Description: 从FTP服务器下载文件
|
static boolean |
uploadFile(String host,
int port,
boolean isAuthenticate,
String username,
String password,
boolean isPassive,
String basePath,
String filePath,
String filename,
InputStream input)
向FTP服务器上传文件
|
public static boolean uploadFile(String host, int port, boolean isAuthenticate, String username, String password, boolean isPassive, String basePath, String filePath, String filename, InputStream input)
host - FTP服务器hostnameport - FTP服务器端口isAuthenticate - 需要鉴权指示username - FTP登录账号password - FTP登录密码isPassive - 被动模式指示basePath - FTP服务器基础目录filePath - FTP服务器文件存放路径。例如分日期存放:/2015/01/01。文件的路径为basePath+filePathfilename - 上传到FTP服务器上的文件名input - 输入流public static boolean downloadFile(String host, int port, String username, String password, String remotePath, String fileName, String localPath)
host - FTP服务器hostnameport - FTP服务器端口username - FTP登录账号password - FTP登录密码remotePath - FTP服务器上的相对路径fileName - 要下载的文件名localPath - 下载后保存到本地的路径Copyright © 2019. All rights reserved.