fix bug https://github.com/AriaLyy/Aria/issues/542
fix bug https://github.com/AriaLyy/Aria/issues/547
修复下载失败时,中断重试无效的问题
增加忽略权限检查的api,`ignoreCheckPermissions()`
This commit is contained in:
laoyuyu
2019-12-02 19:31:39 +08:00
parent 91daecd039
commit 669aa6981c
38 changed files with 294 additions and 241 deletions

View File

@@ -33,7 +33,6 @@ import java.io.UnsupportedEncodingException;
* Created by Aria.Lao on 2017/7/28. D_FTP 单线程上传任务需要FTP 服务器给用户打开append和write的权限
*/
class FtpUThreadTaskAdapter extends BaseFtpThreadTaskAdapter {
private final String TAG = "FtpThreadTask";
private String dir, remotePath;
FtpUThreadTaskAdapter(SubThreadConfig config) {
@@ -66,7 +65,8 @@ class FtpUThreadTaskAdapter extends BaseFtpThreadTaskAdapter {
}
file =
new BufferedRandomAccessFile(getThreadConfig().tempFile, "rwd", getTaskConfig().getBuffSize());
new BufferedRandomAccessFile(getThreadConfig().tempFile, "rwd",
getTaskConfig().getBuffSize());
if (getThreadRecord().startLocation != 0) {
//file.skipBytes((int) getThreadConfig().START_LOCATION);
file.seek(getThreadRecord().startLocation);
@@ -103,10 +103,8 @@ class FtpUThreadTaskAdapter extends BaseFtpThreadTaskAdapter {
private void initPath() throws UnsupportedEncodingException {
dir = CommonUtil.convertFtpChar(charSet, mTaskOption.getUrlEntity().remotePath);
String fileName =
TextUtils.isEmpty(mTaskOption.getNewFileName()) ? CommonUtil.convertFtpChar(charSet,
getEntity().getFileName())
: CommonUtil.convertFtpChar(charSet, mTaskOption.getNewFileName());
String fileName = TextUtils.isEmpty(mTaskOption.getNewFileName()) ? getEntity().getFileName()
: mTaskOption.getNewFileName();
remotePath =
CommonUtil.convertFtpChar(charSet,