This commit is contained in:
laoyuyu
2019-11-19 20:03:25 +08:00
parent 846e6c0720
commit 1b54bfc4ac
15 changed files with 202 additions and 119 deletions

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.arialyy.aria.sftp.download;
import com.arialyy.aria.core.download.DTaskWrapper;
import com.arialyy.aria.sftp.BaseInfoThreadAdapter;
import java.util.Vector;
final class DSFtpInfoThreadAdapter extends BaseInfoThreadAdapter<DTaskWrapper> {
DSFtpInfoThreadAdapter(DTaskWrapper taskWrapper) {
super(taskWrapper);
}
@Override protected boolean handlerFile(Vector vector) {
return false;
}
}

View File

@@ -26,7 +26,7 @@ import com.arialyy.aria.core.loader.NormalLoader;
import com.arialyy.aria.core.wrapper.AbsTaskWrapper;
import com.arialyy.aria.exception.BaseException;
import com.arialyy.aria.ftp.FtpTaskOption;
import com.arialyy.aria.sftp.AbsSFtpFileInfoThread;
import com.arialyy.aria.sftp.SFtpInfoThread;
import com.arialyy.aria.sftp.SFtpUtil;
/**
@@ -57,15 +57,19 @@ public class SFtpDLoaderUtil extends AbsNormalLoaderUtil {
}
@Override protected Runnable createInfoThread() {
return new AbsSFtpFileInfoThread<>(mSftpUtil, (DTaskWrapper) getTaskWrapper(), new OnFileInfoCallback() {
@Override public void onComplete(String key, CompleteInfo info) {
DSFtpInfoThreadAdapter adapter = new DSFtpInfoThreadAdapter((DTaskWrapper) getTaskWrapper());
SFtpInfoThread infoThread = new SFtpInfoThread<>(mSftpUtil, (DTaskWrapper) getTaskWrapper(),
new OnFileInfoCallback() {
@Override public void onComplete(String key, CompleteInfo info) {
}
}
@Override public void onFail(AbsEntity entity, BaseException e, boolean needRetry) {
@Override public void onFail(AbsEntity entity, BaseException e, boolean needRetry) {
mSftpUtil.logout();
}
});
}
});
infoThread.setAdapter(adapter);
return infoThread;
}
}