DownloadUtil 优化

This commit is contained in:
AriaLyy
2017-01-18 17:18:08 +08:00
parent 9bba3cd899
commit 235dfef19d
7 changed files with 468 additions and 321 deletions

View File

@ -19,6 +19,7 @@ package com.arialyy.aria.util;
import android.text.TextUtils;
import android.util.Log;
import com.arialyy.aria.core.DownloadEntity;
import com.arialyy.aria.exception.FileException;
import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -80,9 +81,9 @@ public class CheckUtil {
return false;
} else if (TextUtils.isEmpty(entity.getFileName())) {
//Log.w(TAG, "文件名不能为空");
throw new IllegalArgumentException("文件名不能为null");
throw new FileException("文件名不能为null");
} else if (TextUtils.isEmpty(entity.getDownloadPath())) {
throw new IllegalArgumentException("文件保存路径不能为null");
throw new FileException("文件保存路径不能为null");
}
String fileName = entity.getFileName();
if (fileName.contains(" ")) {