2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-26 16:38:11 -07:00

Removed unused imports

This commit is contained in:
Erik C. Thauvin 2023-10-01 10:30:50 -07:00
parent ec01a626ae
commit 4ac6490dec
5 changed files with 7 additions and 5 deletions

View file

@ -189,7 +189,13 @@ public abstract class ArtifactRetriever {
}
private static URLConnection openUrlConnection(RepositoryArtifact artifact) throws IOException {
var connection = new URL(artifact.location()).openConnection();
String location;
if (artifact.location().matches("[a-z][a-z0-9+\\-.]*://.*")) {
location = artifact.location();
} else {
location = new File(artifact.location()).toURI().toString();
}
var connection = new URL(location).openConnection();
connection.setUseCaches(false);
connection.setRequestProperty("User-Agent", "bld " + BldVersion.getVersion());
return connection;