Remove program stop.

This commit is contained in:
Zaxar163 2018-09-26 17:56:26 +03:00 committed by GitHub
parent cc16748667
commit fc2289708d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ public File getFile() {
}
public void downloadFile() throws IOException {
if (!url.getProtocol().equalsIgnoreCase("http")) throw new IOException("Invalid protocol.");
if (!(url.getProtocol().equalsIgnoreCase("http") || url.getProtocol().equalsIgnoreCase("https"))) throw new IOException("Invalid protocol.");
HttpURLConnection connect = (HttpURLConnection) (url).openConnection();
connect.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"); // for stupid servers
connect.setInstanceFollowRedirects(true);
@ -80,4 +80,4 @@ public void run() {
LogHelper.error(ex);
}
}
}
}