[Esbox-commits] r2116 - branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware

fabricioepa at garage.maemo.org fabricioepa at garage.maemo.org
Tue Sep 8 15:55:53 EEST 2009


Author: fabricioepa
Date: 2009-09-08 15:55:52 +0300 (Tue, 08 Sep 2009)
New Revision: 2116

Modified:
   branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDownloader.java
Log:
do not cancel install wizard if file is downloaded

Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDownloader.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDownloader.java	2009-09-08 12:54:20 UTC (rev 2115)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDownloader.java	2009-09-08 12:55:52 UTC (rev 2116)
@@ -303,8 +303,14 @@
 			downloadFile.setDownloadedSize(getPreviousDownloadSize(localFile));			
 			Integer remoteFileSize = (Integer) remoteFileInfo.get(1);;
 			
-			if (downloadFile.getDownloadedSize() == remoteFileSize.intValue())
-				return Activator.createStatus(Status.OK, "Maemo SDK virtual image is already downloaded.");
+			if (downloadFile.getDownloadedSize() == remoteFileSize.intValue()){
+				
+				if(nPart == downloadFile.getNumParts()){
+					downloadFile.complete();
+					return Activator.createStatus(Status.OK, "Maemo SDK virtual image is already downloaded.");
+				}else
+					continue; //check next part
+			}
 			
 			HttpURLConnection connection = null;
 			RandomFileOutputStream out = null;
@@ -375,7 +381,7 @@
 					}
 					
 					if(downloadFile.getStatus() == MaemoSDKVMInfo.Status.DOWNLOADING){
-						thread.doResume();
+						if(thread.isPaused()) thread.doResume();
 					}
 				}
 				
@@ -412,9 +418,11 @@
 		downloadFile.setDownloadedSize(getPreviousDownloadSize(localFile));
 		Integer remoteFileSize = (Integer) remoteFileInfo.get(1);
 
-		if (downloadFile.getDownloadedSize() == remoteFileSize.intValue())
+		if (downloadFile.getDownloadedSize() == remoteFileSize.intValue()){
+			downloadFile.complete();
 			return Activator.createStatus(Status.OK,
 					"Maemo SDK virtual image is already downloaded.");
+		}
 
 		HttpURLConnection connection = null;
 		RandomFileOutputStream out = null;



More information about the Esbox-commits mailing list