和obu联调升级功能完成
This commit is contained in:
@@ -51,13 +51,11 @@ public class DownloadThread extends Thread {
|
||||
int start = threadBean.getStart() + threadBean.getFinished();
|
||||
connection.setRequestProperty("Range","bytes="+start+"-"+threadBean.getEnd());
|
||||
//设置写入位置
|
||||
Log.d("liyz", "fileBean.getFileName() = " + fileBean.getFileName() + "---Config.downLoadPath = " + Config.downLoadPath);
|
||||
File file = new File(fileBean.getFileName().contains(".zip") ? Config.downLoadObuPath : Config.downLoadPath,fileBean.getFileName());
|
||||
raf = new RandomAccessFile(file,"rwd");
|
||||
raf.seek(start);
|
||||
//开始下载
|
||||
Log.d(DOWN_LOAD_TAG, "DownloadThread connection.getResponseCode() = " + connection.getResponseCode() + "---threadBean.getUrl() =" + threadBean.getUrl());
|
||||
Log.d("liyz", "DownloadThread connection.getResponseCode() = " + connection.getResponseCode() + "---threadBean.getUrl() =" + threadBean.getUrl());
|
||||
if(connection.getResponseCode() == HttpURLConnection.HTTP_PARTIAL){
|
||||
inputStream = connection.getInputStream();
|
||||
byte[] bytes = new byte[1024];
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.mogo.eagle.core.utilcode.breakpoint.services.DownloadService;
|
||||
public class DownloadUtils {
|
||||
|
||||
public static void downLoad(Context context, String url, String savePath, String fileName, int downloadThreadCount, IDownload iDownload) {
|
||||
Log.d("liyz", "---DownloadUtils fileName = " + fileName);
|
||||
FileBean fileBean = new FileBean(0, savePath, fileName, url, 0);
|
||||
fileBean.setThreadCount(downloadThreadCount);
|
||||
Intent startIntent = new Intent(context, DownloadService.class);
|
||||
|
||||
Reference in New Issue
Block a user