Skip to content

Commit f642799

Browse files
committed
Remove imports
1 parent a24da74 commit f642799

File tree

5 files changed

+0
-66
lines changed

5 files changed

+0
-66
lines changed

src/main/java/org/hydev/mcpm/client/Downloader.java

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@
1111
import java.io.File;
1212
import java.io.IOException;
1313
import java.nio.file.Files;
14-
import java.util.HashMap;
15-
import java.util.Map;
16-
import java.util.concurrent.ExecutorService;
17-
import java.util.concurrent.Executors;
18-
import java.util.concurrent.TimeUnit;
19-
2014
/**
2115
* File downloader
2216
*/
2317
public class Downloader
2418
{
25-
/** Number of simultaneous downloads */
26-
private int threads = 5;
27-
2819
private final ProgressBar bar = new ProgressBar(ProgressBarTheme.ASCII_THEME);
2920

3021
/**
@@ -78,51 +69,4 @@ public void downloadFile(String url, String to)
7869
throw new RuntimeException(e);
7970
}
8071
}
81-
82-
/**
83-
* Download multiple files from the internet to local storage through HTTP requests
84-
* <p>
85-
* The implementation must use multithreading
86-
*
87-
* @param urls Mapping of remote urls to local file paths
88-
*/
89-
public void downloadFiles(Map<String, String> urls)
90-
{
91-
try (ExecutorService executor = Executors.newFixedThreadPool(threads))
92-
{
93-
var files = urls.keySet().stream().toList();
94-
95-
if (files.size() > 0)
96-
{
97-
for (String url : files)
98-
{
99-
executor.submit(() ->
100-
{
101-
String to = urls.get(url);
102-
downloadFile(url, to);
103-
});
104-
}
105-
executor.shutdown();
106-
// All files submitted for downloading
107-
108-
//noinspection ResultOfMethodCallIgnored
109-
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
110-
111-
// All files are completely downloaded
112-
}
113-
} catch (InterruptedException e) { /* do nothing */ }
114-
}
115-
116-
/**
117-
* Setter for threads
118-
*
119-
* @param threads Number of simultaneous downloads
120-
* @return this (for fluent access)
121-
*/
122-
@SuppressWarnings("unused")
123-
public Downloader threads(int threads)
124-
{
125-
this.threads = threads;
126-
return this;
127-
}
12872
}

src/main/java/org/hydev/mcpm/client/display/ProgressRowBoundary.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ public interface ProgressRowBoundary {
1515
*/
1616
String toString(ProgressBarTheme theme, int cols);
1717

18-
/**
19-
* Increase progress by incr.
20-
*
21-
* @param incr Increase amount
22-
*/
23-
void increase(long incr);
24-
2518
/**
2619
* Update the progress.
2720
*

src/main/java/org/hydev/mcpm/client/display/progress/ProgressBar.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.hydev.mcpm.client.display.ProgressBarBoundary;
55
import org.hydev.mcpm.client.display.ProgressRowBoundary;
66
import org.hydev.mcpm.utils.ConsoleUtils;
7-
import org.jetbrains.annotations.NotNull;
87

98
import java.io.PrintStream;
109
import java.util.ArrayList;

src/main/java/org/hydev/mcpm/client/display/progress/ProgressRow.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void setPb(ProgressBarBoundary pb)
9191
*
9292
* @param incr Increase amount
9393
*/
94-
@Override
9594
public void increase(long incr)
9695
{
9796
if (this.completed >= total) return;

src/main/java/org/hydev/mcpm/utils/ZstdUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import java.lang.reflect.InvocationTargetException;
99
import java.lang.reflect.Method;
10-
import java.nio.charset.StandardCharsets;
1110
import java.util.Arrays;
1211

1312
/**

0 commit comments

Comments
 (0)