|
|
@ -16,7 +16,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
package com.arialyy.aria.core.command.normal; |
|
|
|
package com.arialyy.aria.core.command.normal; |
|
|
|
|
|
|
|
|
|
|
|
import com.arialyy.aria.core.download.DownloadGroupEntity; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.download.DownloadTaskEntity; |
|
|
|
import com.arialyy.aria.core.download.DownloadTaskEntity; |
|
|
|
import com.arialyy.aria.core.inf.AbsTaskEntity; |
|
|
|
import com.arialyy.aria.core.inf.AbsTaskEntity; |
|
|
|
import com.arialyy.aria.core.upload.UploadTaskEntity; |
|
|
|
import com.arialyy.aria.core.upload.UploadTaskEntity; |
|
|
@ -40,7 +39,7 @@ final class CancelAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> { |
|
|
|
mQueue.removeAllTask(); |
|
|
|
mQueue.removeAllTask(); |
|
|
|
if (mTaskEntity instanceof DownloadTaskEntity) { |
|
|
|
if (mTaskEntity instanceof DownloadTaskEntity) { |
|
|
|
handleDownloadRemove(); |
|
|
|
handleDownloadRemove(); |
|
|
|
} else { |
|
|
|
} else if (mTaskEntity instanceof UploadTaskEntity){ |
|
|
|
handleUploadRemove(); |
|
|
|
handleUploadRemove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -50,6 +49,7 @@ final class CancelAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void handleUploadRemove() { |
|
|
|
private void handleUploadRemove() { |
|
|
|
List<UploadTaskEntity> allEntity = DbEntity.findAllData(UploadTaskEntity.class); |
|
|
|
List<UploadTaskEntity> allEntity = DbEntity.findAllData(UploadTaskEntity.class); |
|
|
|
|
|
|
|
if (allEntity == null || allEntity.size() == 0) return; |
|
|
|
for (UploadTaskEntity entity : allEntity) { |
|
|
|
for (UploadTaskEntity entity : allEntity) { |
|
|
|
CommonUtil.delUploadTaskConfig(mTaskEntity.removeFile, entity); |
|
|
|
CommonUtil.delUploadTaskConfig(mTaskEntity.removeFile, entity); |
|
|
|
} |
|
|
|
} |
|
|
@ -60,6 +60,7 @@ final class CancelAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void handleDownloadRemove() { |
|
|
|
private void handleDownloadRemove() { |
|
|
|
List<DownloadTaskEntity> allEntity = DbEntity.findAllData(DownloadTaskEntity.class); |
|
|
|
List<DownloadTaskEntity> allEntity = DbEntity.findAllData(DownloadTaskEntity.class); |
|
|
|
|
|
|
|
if (allEntity == null || allEntity.size() == 0) return; |
|
|
|
for (DownloadTaskEntity entity : allEntity) { |
|
|
|
for (DownloadTaskEntity entity : allEntity) { |
|
|
|
CommonUtil.delDownloadTaskConfig(mTaskEntity.removeFile, entity); |
|
|
|
CommonUtil.delDownloadTaskConfig(mTaskEntity.removeFile, entity); |
|
|
|
} |
|
|
|
} |
|
|
|