From 11c10175daa5a4490b4aa241b6fcab6ff6ff82c3 Mon Sep 17 00:00:00 2001 From: Zahra Gharagozloo Mazlaghan Date: Fri, 12 Jun 2026 12:13:05 +0330 Subject: [PATCH] ProgressMonitor completed. --- src/main/java/ProgressMonitor.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/ProgressMonitor.java b/src/main/java/ProgressMonitor.java index 475c0e0..012b9bc 100644 --- a/src/main/java/ProgressMonitor.java +++ b/src/main/java/ProgressMonitor.java @@ -16,16 +16,6 @@ public class ProgressMonitor implements Runnable { @Override public void run() { - // TODO: - // Repeatedly check chunk progress until all chunks are completed. - // In each loop: - // 1. Read the downloaded size from every chunk - // 2. Add all downloaded amounts to totalDownloadedMB - // 3. Count completed chunks - // 4. Print a progress message - // 5. If completedChunks == chunks.size(), print a final monitor message and stop - // 6. Otherwise sleep for monitorDelayMs and continue - while (true) { double totalDownloadedMB = 0.0; @@ -54,9 +44,10 @@ public class ProgressMonitor implements Runnable { chunks.size() ); - - // TODO: - // If all chunks are completed, print a final message and exit the loop + if (completedChunks == chunks.size()) { + System.out.println("All chunks have completed downloading. Monitoring stopped."); + break; + } try { Thread.sleep(monitorDelayMs);