public class SftpDownloader extends BaseFileDownloader
bufferSize, fileSizeEqualOverride, forceOverride, local, lock, progress, remote, remoteFileLength
Constructor and Description |
---|
SftpDownloader(SftpExecutor executor,
String remote,
File local) |
SftpDownloader(SftpExecutor executor,
String remote,
String local) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
终止传输
|
void |
close()
安全关闭
|
SftpExecutor |
getExecutor() |
protected long |
getRemoteFileSize()
获取远程文件大小
|
protected void |
initDownload(boolean breakPoint,
long skip)
准开始下载
|
protected int |
read(byte[] bs)
读取数据
|
void |
run() |
protected void |
transferFinish()
传输完成回调
|
breakPointResume, checkRemoteFilePresentSizeEqual, download, fileSizeEqualOverride, forceOverride, getProgress, getRemoteFileLength, startDownload
public SftpDownloader(SftpExecutor executor, String remote, String local)
public SftpDownloader(SftpExecutor executor, String remote, File local)
public void run()
protected long getRemoteFileSize()
BaseFileDownloader
getRemoteFileSize
in class BaseFileDownloader
protected void initDownload(boolean breakPoint, long skip) throws IOException
BaseFileDownloader
initDownload
in class BaseFileDownloader
breakPoint
- 是否为断点续传skip
- 跳过的长度IOException
- IOExceptionprotected int read(byte[] bs) throws IOException
BaseFileDownloader
read
in class BaseFileDownloader
bs
- bsIOException
- IOExceptionprotected void transferFinish()
BaseFileDownloader
transferFinish
in class BaseFileDownloader
public void close()
SafeCloseable
public void abort()
IFileTransfer
public SftpExecutor getExecutor()
Copyright © 2024. All rights reserved.