Fix to the partial data downloading
This commit is contained in:
@@ -223,6 +223,7 @@ class DataDownloader extends Thread
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Resources res = Parent.getResources();
|
Resources res = Parent.getResources();
|
||||||
|
boolean forceOverwrite = false;
|
||||||
|
|
||||||
String path = getOutFilePath(DownloadFlagFileName);
|
String path = getOutFilePath(DownloadFlagFileName);
|
||||||
InputStream checkFile = null;
|
InputStream checkFile = null;
|
||||||
@@ -251,7 +252,9 @@ class DataDownloader extends Thread
|
|||||||
throw new IOException();
|
throw new IOException();
|
||||||
Status.setText( res.getString(R.string.download_unneeded) );
|
Status.setText( res.getString(R.string.download_unneeded) );
|
||||||
return true;
|
return true;
|
||||||
} catch ( IOException e ) {};
|
} catch ( IOException e ) {
|
||||||
|
forceOverwrite = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
checkFile = null;
|
checkFile = null;
|
||||||
|
|
||||||
@@ -291,7 +294,7 @@ class DataDownloader extends Thread
|
|||||||
url = url.substring( url.indexOf(":", 1) + 1 );
|
url = url.substring( url.indexOf(":", 1) + 1 );
|
||||||
DoNotUnzip = true;
|
DoNotUnzip = true;
|
||||||
File partialDownload = new File( path );
|
File partialDownload = new File( path );
|
||||||
if( partialDownload.exists() && !partialDownload.isDirectory() )
|
if( partialDownload.exists() && !partialDownload.isDirectory() && !forceOverwrite )
|
||||||
partialDownloadLen = partialDownload.length();
|
partialDownloadLen = partialDownload.length();
|
||||||
}
|
}
|
||||||
Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.connecting_to, url) );
|
Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.connecting_to, url) );
|
||||||
|
|||||||
Reference in New Issue
Block a user