public abstract class AbstractFtp extends Object implements Ftp
Modifier and Type | Field and Description |
---|---|
protected FtpConfig |
ftpConfig |
DEFAULT_CHARSET
Modifier | Constructor and Description |
---|---|
protected |
AbstractFtp(FtpConfig config)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
download(String path,
File outFile,
String tempFileSuffix)
下载文件-避免未完成的文件
来自:https://gitee.com/dromara/hutool/pulls/407 此方法原理是先在目标文件同级目录下创建临时文件,下载之,等下载完毕后重命名,避免因下载错误导致的文件不完整。 |
boolean |
exist(String path)
文件或目录是否存在
提供路径为空则返回 false
提供路径非目录但是以'/'或'\'结尾返回false
文件名是'.' |
FtpConfig |
getConfig()
获取FTP配置
|
void |
mkDirs(String dir)
创建指定文件夹及其父目录,从根目录开始创建,创建完成后回到默认的工作目录
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cd, delDir, delFile, download, getFileStream, isDir, ls, mkdir, pwd, reconnectIfTimeout, recursiveDownloadFolder, toParent, uploadFile
protected FtpConfig ftpConfig
protected AbstractFtp(FtpConfig config)
config
- FTP配置public boolean exist(String path)
Ftp
false
false
false
public void mkDirs(String dir)
Ftp
public void download(String path, File outFile, String tempFileSuffix)
path
- 文件路径outFile
- 输出文件或目录tempFileSuffix
- 临时文件后缀,默认".temp"Copyright © 2025. All rights reserved.