Skip to content

Commit

Permalink
Fix #683: FrontEnd 1.15.1 (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 23, 2024
1 parent 957af0e commit 91143c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -59,7 +60,8 @@ public VertxFileDownloader(Vertx vertx) {
this.webClient = WebClient.create(vertx, options);
}

public void download(String downloadUrl, String destination, String userName, String password) throws DownloadException {
public void download(String downloadUrl, String destination, String userName, String password,
Map<String, String> httpHeaders) throws DownloadException {
System.setProperty("https.protocols", "TLSv1.2");
String fixedDownloadUrl = downloadUrl;

Expand All @@ -77,6 +79,12 @@ public void download(String downloadUrl, String destination, String userName, St
if (userName != null && password != null) {
httpRequest.basicAuthentication(userName, password);
}
if (httpHeaders != null) {
for (Map.Entry<String, String> httpHeader : httpHeaders.entrySet()) {
httpRequest.putHeader(httpHeader.getKey(), httpHeader.getValue());
}
}

final Future<HttpResponse<Void>> future = httpRequest
.expect(ResponsePredicate.SC_SUCCESS)
.as(BodyCodec.pipe(destinationFile))
Expand All @@ -94,5 +102,4 @@ public void download(String downloadUrl, String destination, String userName, St
throw new RuntimeException(e);
}
}

}
}
12 changes: 3 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,22 @@
<quarkus.version>3.12.0</quarkus.version>
<quarkus-playright.version>1.0.0</quarkus-playright.version>
<assertj.version>3.26.3</assertj.version>
<frontend-plugin.version>1.15.0</frontend-plugin.version>
<frontend-plugin.version>1.15.1</frontend-plugin.version>
</properties>

<developers>
<developer>
<name>Andy Damevin</name>
<email>ia3andy@gmail.com</email>
<organization>Red Hat</organization>
<organizationUrl>http://www.redhat.com</organizationUrl>
<organizationUrl>https://www.redhat.com</organizationUrl>
</developer>
<developer>
<name>Emil Lefkof</name>
<email>mellowaredev@gmail.com</email>
<organization>KSM Technology</organization>
<organizationUrl>https://www.ksmpartners.com/</organizationUrl>
</developer>
<developer>
<name>Shivam Sharma</name>
<email>meshivam81@gmail.com</email>
<organization>Hyperfoil</organization>
<organizationUrl>https://github.com/Hyperfoil</organizationUrl>
</developer>
</developers>

<dependencyManagement>
Expand Down Expand Up @@ -125,4 +119,4 @@
</modules>
</profile>
</profiles>
</project>
</project>

0 comments on commit 91143c7

Please sign in to comment.