From 7379faedfe235141f8f01dc7a8cc1754f0303357 Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Wed, 28 Jun 2017 10:33:10 +0530 Subject: [PATCH 1/2] formatting download message in downloadArtifcats method --- .../src/main/java/org.carbon.android.emulator/TryIt.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java index 5ca395e3c..473bbecfe 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java @@ -140,13 +140,15 @@ public class TryIt { while ((count = in.read(data, 0, 1024)) != -1) { out.write(data, 0, count); sumCount += count; - if ((size > 0 && (System.currentTimeMillis() - startingTime > 5000)) + if ((size > 0 && (System.currentTimeMillis() - startingTime > 100)) || (sumCount / size * 100.0) == 100) { - System.out.println("Downloading: " - + new DecimalFormat("#.##").format((sumCount / size * 100.0)) + " %"); + System.out.print("\r\r\r\r\r\r\r\r\r\r"); + System.out.print("Downloading: " + + new DecimalFormat("#0.00").format((sumCount / size * 100.00)) + " %"); startingTime = System.currentTimeMillis(); } } + System.out.println(); } catch (MalformedURLException e) { System.out.println("Error in download URL of " + localPath); System.out.println("URL provided " + remotePath); From 42fce6e9feab290fa1bd94c1b5fea93cc9dc6dd1 Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Wed, 28 Jun 2017 10:35:56 +0530 Subject: [PATCH 2/2] adding system.out.println(Done..) in extract folder method --- .../src/main/java/org.carbon.android.emulator/TryIt.java | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java index 473bbecfe..b1a02a406 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/src/main/java/org.carbon.android.emulator/TryIt.java @@ -899,6 +899,7 @@ public class TryIt { } catch (IOException e) { handleException("Extraction of " + zipFile + " failed", e); } + System.out.println("Done ..."); if (!new File(zipFile).delete()) { System.out.println("Downloaded zip : " + zipFile + " - not deleted"); }