|
|
@ -35,11 +35,6 @@ class DNormalConfigHandler<TARGET extends AbsTarget> implements IConfigHandler { |
|
|
|
private TARGET mTarget; |
|
|
|
private TARGET mTarget; |
|
|
|
private DTaskWrapper mWrapper; |
|
|
|
private DTaskWrapper mWrapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 资源地址 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private String mUrl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param taskId 第一次下载,taskId为-1 |
|
|
|
* @param taskId 第一次下载,taskId为-1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -67,12 +62,13 @@ class DNormalConfigHandler<TARGET extends AbsTarget> implements IConfigHandler { |
|
|
|
ALog.e(TAG, "url更新失败,newUrl为null"); |
|
|
|
ALog.e(TAG, "url更新失败,newUrl为null"); |
|
|
|
return mTarget; |
|
|
|
return mTarget; |
|
|
|
} |
|
|
|
} |
|
|
|
if (mUrl.equals(newUrl)) { |
|
|
|
if (mEntity.getUrl().equals(newUrl)) { |
|
|
|
ALog.e(TAG, "url更新失败,新的下载url和旧的url一致"); |
|
|
|
ALog.e(TAG, "url更新失败,新的下载url和旧的url一致"); |
|
|
|
return mTarget; |
|
|
|
return mTarget; |
|
|
|
} |
|
|
|
} |
|
|
|
getWrapper().setRefreshInfo(true); |
|
|
|
getWrapper().setRefreshInfo(true); |
|
|
|
getWrapper().setTempUrl(newUrl); |
|
|
|
getWrapper().setTempUrl(newUrl); |
|
|
|
|
|
|
|
ALog.d(TAG, "更新url成功"); |
|
|
|
return mTarget; |
|
|
|
return mTarget; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -81,7 +77,8 @@ class DNormalConfigHandler<TARGET extends AbsTarget> implements IConfigHandler { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override public boolean taskExists() { |
|
|
|
@Override public boolean taskExists() { |
|
|
|
return DbEntity.checkDataExist(DownloadEntity.class, "url=?", mUrl); |
|
|
|
return DbEntity.checkDataExist(DownloadEntity.class, "rowid=?", |
|
|
|
|
|
|
|
String.valueOf(mEntity.getId())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override public boolean isRunning() { |
|
|
|
@Override public boolean isRunning() { |
|
|
@ -93,7 +90,6 @@ class DNormalConfigHandler<TARGET extends AbsTarget> implements IConfigHandler { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setUrl(String url) { |
|
|
|
void setUrl(String url) { |
|
|
|
this.mUrl = url; |
|
|
|
|
|
|
|
mEntity.setUrl(url); |
|
|
|
mEntity.setUrl(url); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|