Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderate Code Cleanup #11

Merged
merged 16 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/rife/bld/dependencies/ArtifactRetriever.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ public boolean transferIntoDirectory(RepositoryArtifact artifact, File directory
}

private static URLConnection openUrlConnection(RepositoryArtifact artifact) throws IOException {
var connection = new URL(artifact.location()).openConnection();
String location;
ethauvin marked this conversation as resolved.
Show resolved Hide resolved
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;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/rife/bld/operations/TestJUnitOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.function.Function;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertNull;

public class TestJUnitOperation {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.jar.JarFile;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TestUberJarOperation {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package rife.bld.operations;

import org.junit.jupiter.api.Test;
import rife.bld.dependencies.DependencyScopes;
import rife.bld.WebProject;
import rife.bld.dependencies.*;
import rife.tools.FileUtils;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/rife/bld/operations/TestWarOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.regex.Pattern;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TestWarOperation {
@Test
Expand Down