工具重命名

pull/2/head
lyy 8 years ago
parent 96fb3b0909
commit 493810d0b0
  1. 8
      app/src/main/java/com/arialyy/simple/activity/SingleTaskActivity.java
  2. 8
      app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
  3. 4
      app/src/main/java/com/arialyy/simple/module/DownloadModule.java
  4. 8
      downloadutil/src/main/java/com/arialyy/downloadutil/core/command/IDownloadCmd.java
  5. 11
      downloadutil/src/main/java/com/arialyy/downloadutil/core/queue/DownloadTaskQueue.java
  6. 9
      downloadutil/src/main/java/com/arialyy/downloadutil/core/queue/ITaskQueue.java
  7. 12
      downloadutil/src/main/java/com/arialyy/downloadutil/core/queue/pool/CachePool.java
  8. 41
      downloadutil/src/main/java/com/arialyy/downloadutil/core/queue/pool/ExecutePool.java
  9. 2
      downloadutil/src/main/java/com/arialyy/downloadutil/core/scheduler/DownloadSchedulers.java
  10. 16
      downloadutil/src/main/java/com/arialyy/downloadutil/core/task/DownloadUtil.java
  11. 8
      downloadutil/src/main/java/com/arialyy/downloadutil/help/Lockhelp.java
  12. 4
      downloadutil/src/main/java/com/arialyy/downloadutil/orm/DbEntity.java
  13. 28
      downloadutil/src/main/java/com/arialyy/downloadutil/orm/DbUtil.java
  14. 6
      downloadutil/src/main/java/com/arialyy/downloadutil/util/CheckUtil.java
  15. 2
      downloadutil/src/main/java/com/arialyy/downloadutil/util/CommonUtil.java
  16. 4
      downloadutil/src/main/java/com/arialyy/downloadutil/util/PathUtil.java

@ -19,7 +19,7 @@ import com.arialyy.downloadutil.core.DownloadManager;
import com.arialyy.downloadutil.core.command.CmdFactory;
import com.arialyy.downloadutil.core.command.IDownloadCmd;
import com.arialyy.downloadutil.orm.DbEntity;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import com.arialyy.frame.util.show.L;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseActivity;
@ -50,7 +50,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
super.handleMessage(msg);
switch (msg.what) {
case DOWNLOAD_PRE:
mSize.setText(Util.formatFileSize((Long) msg.obj));
mSize.setText(CommonUtil.formatFileSize((Long) msg.obj));
setBtState(false);
break;
case DOWNLOAD_FAILE:
@ -70,7 +70,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
break;
case DOWNLOAD_RESUME:
Toast.makeText(SingleTaskActivity.this,
"恢复下载,恢复位置 ==> " + Util.formatFileSize((Long) msg.obj), Toast.LENGTH_SHORT).show();
"恢复下载,恢复位置 ==> " + CommonUtil.formatFileSize((Long) msg.obj), Toast.LENGTH_SHORT).show();
setBtState(false);
break;
case DOWNLOAD_COMPLETE:
@ -174,7 +174,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
new String[] { mDownloadUrl });
if (mEntity != null) {
mPb.setProgress((int) ((mEntity.getCurrentProgress() * 100) / mEntity.getFileSize()));
mSize.setText(Util.formatFileSize(mEntity.getFileSize()));
mSize.setText(CommonUtil.formatFileSize(mEntity.getFileSize()));
if (mEntity.getState() == DownloadEntity.STATE_DOWNLOAD_ING) {
setBtState(false);
} else if (mEntity.isDownloadComplete()) {

@ -12,7 +12,7 @@ import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.core.DownloadManager;
import com.arialyy.downloadutil.core.command.CmdFactory;
import com.arialyy.downloadutil.core.command.IDownloadCmd;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import com.arialyy.simple.R;
import com.arialyy.simple.widget.HorizontalProgressBarWithNumber;
import java.util.ArrayList;
@ -121,8 +121,8 @@ public class DownloadAdapter extends AbsRVAdapter<DownloadEntity, DownloadAdapte
}
holder.bt.setText(str);
holder.bt.setTextColor(getColor(color));
holder.speed.setText(Util.formatFileSize(speed) + "/s");
holder.fileSize.setText(covertCurrentSize(progress) + "/" + Util.formatFileSize(size));
holder.speed.setText(CommonUtil.formatFileSize(speed) + "/s");
holder.fileSize.setText(covertCurrentSize(progress) + "/" + CommonUtil.formatFileSize(size));
holder.cancel.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
mData.remove(item);
@ -134,7 +134,7 @@ public class DownloadAdapter extends AbsRVAdapter<DownloadEntity, DownloadAdapte
}
private String covertCurrentSize(long currentSize) {
String size = Util.formatFileSize(currentSize);
String size = CommonUtil.formatFileSize(currentSize);
return size.substring(0, size.length() - 1);
}

@ -5,7 +5,7 @@ import android.content.IntentFilter;
import android.os.Environment;
import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.core.DownloadManager;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import com.arialyy.frame.util.AndroidUtils;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.simple.R;
@ -66,7 +66,7 @@ public class DownloadModule extends BaseModule {
String[] urls = getContext().getResources().getStringArray(R.array.test_apk_download_url);
int i = 0;
for (String url : urls) {
String fileName = Util.keyToHashCode(url) + ".apk";
String fileName = CommonUtil.keyToHashCode(url) + ".apk";
DownloadEntity entity = new DownloadEntity();
entity.setDownloadUrl(url);
entity.setDownloadPath(getDownloadPath(url));

@ -3,8 +3,8 @@ package com.arialyy.downloadutil.core.command;
import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.core.DownloadManager;
import com.arialyy.downloadutil.core.queue.ITaskQueue;
import com.arialyy.downloadutil.help.CheckHelp;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CheckUtil;
import com.arialyy.downloadutil.util.CommonUtil;
/**
* Created by lyy on 2016/8/22.
@ -19,11 +19,11 @@ public abstract class IDownloadCmd {
* @param entity 下载实体
*/
IDownloadCmd(DownloadEntity entity) {
if (!CheckHelp.checkDownloadEntity(entity)) {
if (!CheckUtil.checkDownloadEntity(entity)) {
return;
}
mEntity = entity;
TAG = Util.getClassName(this);
TAG = CommonUtil.getClassName(this);
mQueue = DownloadManager.getInstance().getTaskQueue();
}

@ -3,12 +3,12 @@ package com.arialyy.downloadutil.core.queue;
import android.content.Context;
import android.util.Log;
import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.core.queue.pool.CachePool;
import com.arialyy.downloadutil.core.queue.pool.ExecutePool;
import com.arialyy.downloadutil.core.scheduler.DownloadSchedulers;
import com.arialyy.downloadutil.core.scheduler.IDownloadSchedulers;
import com.arialyy.downloadutil.core.task.Task;
import com.arialyy.downloadutil.core.task.TaskFactory;
import com.arialyy.downloadutil.core.scheduler.IDownloadSchedulers;
import com.arialyy.downloadutil.core.queue.pool.CachePool;
import com.arialyy.downloadutil.core.queue.pool.ExecutePool;
/**
* Created by lyy on 2016/8/17.
@ -20,6 +20,7 @@ public class DownloadTaskQueue implements ITaskQueue {
private ExecutePool mExecutePool = ExecutePool.getInstance();
private Context mContext;
private IDownloadSchedulers mSchedulers;
private int mDownloadNum = 2;
private DownloadTaskQueue() {
}
@ -93,6 +94,10 @@ public class DownloadTaskQueue implements ITaskQueue {
}
}
@Override public void setDownloadNum(int downloadNum) {
}
@Override public Task createTask(DownloadEntity entity) {
Task task = TaskFactory.getInstance().createTask(mContext, entity, mSchedulers);
mCachePool.putTask(task);

@ -1,8 +1,8 @@
package com.arialyy.downloadutil.core.queue;
import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.core.task.Task;
import com.arialyy.downloadutil.core.scheduler.IDownloadSchedulers;
import com.arialyy.downloadutil.core.task.Task;
/**
* Created by lyy on 2016/8/16.
@ -10,6 +10,13 @@ import com.arialyy.downloadutil.core.scheduler.IDownloadSchedulers;
*/
public interface ITaskQueue extends IDownloader {
/**
* 设置下载任务数
*
* @param downloadNum 下载任务数
*/
public void setDownloadNum(int downloadNum);
/**
* 创建一个新的下载任务创建时只是将新任务存储到缓存池
*

@ -4,7 +4,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.arialyy.downloadutil.core.task.Task;
import com.arialyy.downloadutil.core.queue.IPool;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@ -49,7 +49,7 @@ public class CachePool implements IPool {
boolean s = mCacheQueue.offer(task);
Log.d(TAG, "任务添加" + (s ? "成功" : "失败,【" + url + "】"));
if (s) {
mCacheArray.put(Util.keyToHashKey(url), task);
mCacheArray.put(CommonUtil.keyToHashKey(url), task);
}
return s;
}
@ -61,7 +61,7 @@ public class CachePool implements IPool {
Task task = mCacheQueue.poll();
if (task != null) {
String url = task.getDownloadEntity().getDownloadUrl();
mCacheArray.remove(Util.keyToHashKey(url));
mCacheArray.remove(CommonUtil.keyToHashKey(url));
}
return task;
}
@ -73,7 +73,7 @@ public class CachePool implements IPool {
Log.e(TAG, "请传入有效的下载链接");
return null;
}
String key = Util.keyToHashKey(downloadUrl);
String key = CommonUtil.keyToHashKey(downloadUrl);
return mCacheArray.get(key);
}
}
@ -84,7 +84,7 @@ public class CachePool implements IPool {
Log.e(TAG, "任务不能为空");
return false;
} else {
String key = Util.keyToHashKey(task.getDownloadEntity().getDownloadUrl());
String key = CommonUtil.keyToHashKey(task.getDownloadEntity().getDownloadUrl());
mCacheArray.remove(key);
return mCacheQueue.remove(task);
}
@ -97,7 +97,7 @@ public class CachePool implements IPool {
Log.e(TAG, "请传入有效的下载链接");
return false;
}
String key = Util.keyToHashKey(downloadUrl);
String key = CommonUtil.keyToHashKey(downloadUrl);
Task task = mCacheArray.get(key);
mCacheArray.remove(key);
return mCacheQueue.remove(task);

@ -2,9 +2,9 @@ package com.arialyy.downloadutil.core.queue.pool;
import android.text.TextUtils;
import android.util.Log;
import com.arialyy.downloadutil.core.task.Task;
import com.arialyy.downloadutil.core.queue.IPool;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.core.task.Task;
import com.arialyy.downloadutil.util.CommonUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
@ -18,13 +18,13 @@ public class ExecutePool implements IPool {
private static final String TAG = "ExecutePool";
private static final Object LOCK = new Object();
private static final long TIME_OUT = 1000;
public static int SIZE = 2;
private static volatile ExecutePool INSTANCE = null;
public static int mSize = 2;
private ArrayBlockingQueue<Task> mExecuteQueue;
private Map<String, Task> mExecuteArray;
private ExecutePool() {
mExecuteQueue = new ArrayBlockingQueue<>(SIZE);
mExecuteQueue = new ArrayBlockingQueue<>(mSize);
mExecuteArray = new HashMap<>();
}
@ -48,7 +48,7 @@ public class ExecutePool implements IPool {
Log.e(TAG, "队列中已经包含了该任务,任务下载链接【" + url + "】");
return false;
} else {
if (mExecuteQueue.size() >= SIZE) {
if (mExecuteQueue.size() >= mSize) {
if (pollFirstTask()) {
return putNewTask(task);
}
@ -60,6 +60,25 @@ public class ExecutePool implements IPool {
return false;
}
/**
* 设置执行任务数
*
* @param downloadNum 下载数
*/
private void setDownloadNum(int downloadNum) {
try {
ArrayBlockingQueue<Task> temp = new ArrayBlockingQueue<>(downloadNum);
Task task;
while ((task = mExecuteQueue.poll(TIME_OUT, TimeUnit.MICROSECONDS)) != null) {
temp.offer(task);
}
mExecuteQueue = temp;
mSize = downloadNum;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
/**
* 添加新任务
*
@ -71,7 +90,7 @@ public class ExecutePool implements IPool {
Log.w(TAG, "任务添加" + (s ? "成功" : "失败,【" + url + "】"));
if (s) {
newTask.start();
mExecuteArray.put(Util.keyToHashKey(url), newTask);
mExecuteArray.put(CommonUtil.keyToHashKey(url), newTask);
}
return s;
}
@ -88,7 +107,7 @@ public class ExecutePool implements IPool {
}
oldTask.stop();
// wait(200);
String key = Util.keyToHashKey(oldTask.getDownloadEntity().getDownloadUrl());
String key = CommonUtil.keyToHashKey(oldTask.getDownloadEntity().getDownloadUrl());
mExecuteArray.remove(key);
} catch (InterruptedException e) {
e.printStackTrace();
@ -102,7 +121,7 @@ public class ExecutePool implements IPool {
Task task = mExecuteQueue.poll();
if (task != null) {
String url = task.getDownloadEntity().getDownloadUrl();
mExecuteArray.remove(Util.keyToHashKey(url));
mExecuteArray.remove(CommonUtil.keyToHashKey(url));
}
return task;
}
@ -114,7 +133,7 @@ public class ExecutePool implements IPool {
Log.e(TAG, "请传入有效的下载链接");
return null;
}
String key = Util.keyToHashKey(downloadUrl);
String key = CommonUtil.keyToHashKey(downloadUrl);
return mExecuteArray.get(key);
}
}
@ -125,7 +144,7 @@ public class ExecutePool implements IPool {
Log.e(TAG, "任务不能为空");
return false;
} else {
String key = Util.keyToHashKey(task.getDownloadEntity().getDownloadUrl());
String key = CommonUtil.keyToHashKey(task.getDownloadEntity().getDownloadUrl());
mExecuteArray.remove(key);
return mExecuteQueue.remove(task);
}
@ -138,7 +157,7 @@ public class ExecutePool implements IPool {
Log.e(TAG, "请传入有效的下载链接");
return false;
}
String key = Util.keyToHashKey(downloadUrl);
String key = CommonUtil.keyToHashKey(downloadUrl);
Task task = mExecuteArray.get(key);
mExecuteArray.remove(key);
return mExecuteQueue.remove(task);

@ -73,7 +73,7 @@ public class DownloadSchedulers implements IDownloadSchedulers {
switch (msg.what) {
case STOP:
case CANCEL:
if (mQueue.getExecutePool().size() != ExecutePool.SIZE) {
if (mQueue.getExecutePool().size() != ExecutePool.mSize) {
startNextTask(entity);
}
break;

@ -4,7 +4,7 @@ import android.content.Context;
import android.util.Log;
import android.util.SparseArray;
import com.arialyy.downloadutil.core.DownloadEntity;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -165,7 +165,7 @@ final class DownloadUtil implements IDownloadUtil {
try {
if (!configFile.exists()) { //记录文件被删除,则重新下载
isNewTask = true;
Util.createFile(configFile.getPath());
CommonUtil.createFile(configFile.getPath());
} else {
isNewTask = !dFile.exists();
}
@ -192,14 +192,14 @@ final class DownloadUtil implements IDownloadUtil {
if (code == 200) {
int fileLength = conn.getContentLength();
//必须建一个文件
Util.createFile(filePath);
CommonUtil.createFile(filePath);
RandomAccessFile file = new RandomAccessFile(filePath, "rwd");
//设置文件长度
file.setLength(fileLength);
mListener.onPostPre(fileLength);
//分配每条线程的下载区间
Properties pro = null;
pro = Util.loadConfig(configFile);
pro = CommonUtil.loadConfig(configFile);
if (pro.isEmpty()) {
isNewTask = true;
} else {
@ -288,7 +288,7 @@ final class DownloadUtil implements IDownloadUtil {
+ "】\n【filePath:"
+ filePath
+ "】"
+ Util.getPrintException(e));
+ CommonUtil.getPrintException(e));
}
}
}).start();
@ -486,9 +486,9 @@ final class DownloadUtil implements IDownloadUtil {
*/
private void writeConfig(String key, String record) throws IOException {
File configFile = new File(configFPath);
Properties pro = Util.loadConfig(configFile);
Properties pro = CommonUtil.loadConfig(configFile);
pro.setProperty(key, record);
Util.saveConfig(configFile, pro);
CommonUtil.saveConfig(configFile, pro);
}
/**
@ -502,7 +502,7 @@ final class DownloadUtil implements IDownloadUtil {
isStop = true;
Log.e(TAG, msg);
if (ex != null) {
Log.e(TAG, Util.getPrintException(ex));
Log.e(TAG, CommonUtil.getPrintException(ex));
}
if (currentLocation != -1) {
String location = String.valueOf(currentLocation);

@ -1,8 +0,0 @@
package com.arialyy.downloadutil.help;
/**
* Created by AriaLyy@outlook.com on 2016/11/2.
*/
public class LockHelp {
public static final Object LOCK = new Object();
}

@ -1,7 +1,7 @@
package com.arialyy.downloadutil.orm;
import android.support.annotation.NonNull;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
@ -117,7 +117,7 @@ public class DbEntity {
private void updateRowID() {
try {
Field[] fields = Util.getFields(getClass());
Field[] fields = CommonUtil.getFields(getClass());
List<String> where = new ArrayList<>();
List<String> values = new ArrayList<>();
for (Field field : fields) {

@ -6,7 +6,7 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.annotation.NonNull;
import android.util.Log;
import com.arialyy.downloadutil.util.Util;
import com.arialyy.downloadutil.util.CommonUtil;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
@ -71,7 +71,7 @@ public class DbUtil {
return;
}
StringBuilder sb = new StringBuilder();
sb.append("DELETE FROM ").append(Util.getClassName(clazz)).append(" WHERE ");
sb.append("DELETE FROM ").append(CommonUtil.getClassName(clazz)).append(" WHERE ");
int i = 0;
for (Object where : wheres) {
sb.append(where).append("=").append("'").append(values[i]).append("'");
@ -89,10 +89,10 @@ public class DbUtil {
synchronized void modifyData(DbEntity dbEntity) {
mDb = mHelper.getWritableDatabase();
Class<?> clazz = dbEntity.getClass();
Field[] fields = Util.getFields(clazz);
Field[] fields = CommonUtil.getFields(clazz);
if (fields != null && fields.length > 0) {
StringBuilder sb = new StringBuilder();
sb.append("UPDATE ").append(Util.getClassName(dbEntity)).append(" SET ");
sb.append("UPDATE ").append(CommonUtil.getClassName(dbEntity)).append(" SET ");
int i = 0;
for (Field field : fields) {
field.setAccessible(true);
@ -127,7 +127,7 @@ public class DbUtil {
}
mDb = mHelper.getReadableDatabase();
StringBuilder sb = new StringBuilder();
sb.append("SELECT rowid, * FROM ").append(Util.getClassName(clazz));
sb.append("SELECT rowid, * FROM ").append(CommonUtil.getClassName(clazz));
print(FIND_ALL_DATA, sb.toString());
Cursor cursor = mDb.rawQuery(sb.toString(), null);
return cursor.getCount() > 0 ? newInstanceEntity(clazz, cursor) : null;
@ -150,7 +150,7 @@ public class DbUtil {
return null;
}
StringBuilder sb = new StringBuilder();
sb.append("SELECT rowid, * FROM ").append(Util.getClassName(clazz)).append(" where ");
sb.append("SELECT rowid, * FROM ").append(CommonUtil.getClassName(clazz)).append(" where ");
int i = 0;
for (Object where : wheres) {
sb.append(where).append("=").append("'").append(values[i]).append("'");
@ -171,10 +171,10 @@ public class DbUtil {
createTable(clazz);
}
mDb = mHelper.getWritableDatabase();
Field[] fields = Util.getFields(clazz);
Field[] fields = CommonUtil.getFields(clazz);
if (fields != null && fields.length > 0) {
StringBuilder sb = new StringBuilder();
sb.append("INSERT INTO ").append(Util.getClassName(dbEntity)).append("(");
sb.append("INSERT INTO ").append(CommonUtil.getClassName(dbEntity)).append("(");
int i = 0;
for (Field field : fields) {
field.setAccessible(true);
@ -221,7 +221,7 @@ public class DbUtil {
try {
StringBuilder sb = new StringBuilder();
sb.append("SELECT COUNT(*) AS c FROM sqlite_master WHERE type='table' AND name='");
sb.append(Util.getClassName(clazz));
sb.append(CommonUtil.getClassName(clazz));
sb.append("'");
print(TABLE_EXISTS, sb.toString());
cursor = mDb.rawQuery(sb.toString(), null);
@ -247,10 +247,10 @@ public class DbUtil {
if (mDb == null || !mDb.isOpen()) {
mDb = mHelper.getWritableDatabase();
}
Field[] fields = Util.getFields(clazz);
Field[] fields = CommonUtil.getFields(clazz);
if (fields != null && fields.length > 0) {
StringBuilder sb = new StringBuilder();
sb.append("create table ").append(Util.getClassName(clazz)).append("(");
sb.append("create table ").append(CommonUtil.getClassName(clazz)).append("(");
for (Field field : fields) {
field.setAccessible(true);
Ignore ignore = field.getAnnotation(Ignore.class);
@ -333,7 +333,7 @@ public class DbUtil {
*/
synchronized int[] getRowId(Class clazz) {
mDb = mHelper.getReadableDatabase();
Cursor cursor = mDb.rawQuery("SELECT rowid, * FROM " + Util.getClassName(clazz), null);
Cursor cursor = mDb.rawQuery("SELECT rowid, * FROM " + CommonUtil.getClassName(clazz), null);
int[] ids = new int[cursor.getCount()];
int i = 0;
while (cursor.moveToNext()) {
@ -358,7 +358,7 @@ public class DbUtil {
return -1;
}
StringBuilder sb = new StringBuilder();
sb.append("SELECT rowid FROM ").append(Util.getClassName(clazz)).append(" WHERE ");
sb.append("SELECT rowid FROM ").append(CommonUtil.getClassName(clazz)).append(" WHERE ");
int i = 0;
for (Object where : wheres) {
sb.append(where).append("=").append("'").append(values[i]).append("'");
@ -378,7 +378,7 @@ public class DbUtil {
*/
private synchronized <T extends DbEntity> List<T> newInstanceEntity(Class<T> clazz,
Cursor cursor) {
Field[] fields = Util.getFields(clazz);
Field[] fields = CommonUtil.getFields(clazz);
List<T> entitys = new ArrayList<>();
if (fields != null && fields.length > 0) {
try {

@ -1,4 +1,4 @@
package com.arialyy.downloadutil.help;
package com.arialyy.downloadutil.util;
import android.content.res.Resources;
import android.text.TextUtils;
@ -11,8 +11,8 @@ import java.io.File;
* Created by Lyy on 2016/9/23.
* 检查帮助类
*/
public class CheckHelp {
private static final String TAG = "CheckHelp";
public class CheckUtil {
private static final String TAG = "CheckUtil";
/**
* 检测下载实体是否合法

@ -14,7 +14,7 @@ import java.util.Properties;
/**
* Created by lyy on 2016/1/22.
*/
public class Util {
public class CommonUtil {
private static final String TAG = "util";
/**

@ -1,4 +1,4 @@
package com.arialyy.downloadutil.help;
package com.arialyy.downloadutil.util;
import android.os.Environment;
import java.security.MessageDigest;
@ -8,7 +8,7 @@ import java.security.NoSuchAlgorithmException;
* Created by lyy on 2016/9/27.
* 下载路径帮助类
*/
public class PathHelp {
public class PathUtil {
/**
* 下载链接转换保存路径
Loading…
Cancel
Save