Complete the classes

This commit is contained in:
2026-06-04 23:22:30 +03:30
parent 9e5c715088
commit 3111f23b1c
3 changed files with 51 additions and 64 deletions
+6 -13
View File
@@ -16,16 +16,7 @@ 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
System.out.println("[Monitor] Started monitoring progress...");
while (true) {
double totalDownloadedMB = 0.0;
@@ -54,9 +45,11 @@ 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("[Monitor] All chunks downloaded successfully!");
break;
}
try {
Thread.sleep(monitorDelayMs);