From e0a7cc2aafdf033018139565e7e56b17a817b7ef Mon Sep 17 00:00:00 2001 From: Matt Busche Date: Sun, 15 Oct 2023 21:38:56 -0500 Subject: [PATCH] use better URI method --- src/main/java/trap/report/DownloadHelper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/trap/report/DownloadHelper.java b/src/main/java/trap/report/DownloadHelper.java index 76176b3..4889692 100644 --- a/src/main/java/trap/report/DownloadHelper.java +++ b/src/main/java/trap/report/DownloadHelper.java @@ -3,7 +3,6 @@ import java.io.File; import java.io.IOException; import java.net.URI; -import java.net.URISyntaxException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -16,7 +15,7 @@ public class DownloadHelper { - public void downloadFiles(String[] trapTypes) throws IOException, URISyntaxException { + public void downloadFiles(String[] trapTypes) throws IOException { long start = System.currentTimeMillis(); System.out.println("Started downloading files"); @@ -25,7 +24,7 @@ public void downloadFiles(String[] trapTypes) throws IOException, URISyntaxExcep Charset charset = StandardCharsets.UTF_8; for (String type : trapTypes) { System.out.println("Downloading " + type + " file"); - copyURLToFile(new URI(fileUrls.get(type)).toURL(), new File(type + ".csv"), 120000, 120000); + copyURLToFile(URI.create(fileUrls.get(type)).toURL(), new File(type + ".csv"), 120000, 120000); System.out.println("Finished downloading " + type + " file"); System.out.println("Replacing double spaces for " + type + " file");