1919import java .io .IOException ;
2020import java .io .InputStream ;
2121import java .net .HttpURLConnection ;
22- import java .net .URI ;
2322import java .net .URISyntaxException ;
2423import java .nio .file .Files ;
2524import java .nio .file .StandardCopyOption ;
6665import jakarta .ws .rs .ServerErrorException ;
6766import jakarta .ws .rs .core .MediaType ;
6867import jakarta .ws .rs .core .Response ;
69- import jakarta .ws .rs .core .UriBuilder ;
7068import org .apache .commons .lang3 .StringUtils ;
7169import org .apache .commons .lang3 .tuple .Pair ;
7270import org .eclipse .microprofile .config .inject .ConfigProperty ;
@@ -87,9 +85,6 @@ public class ReportResource {
8785 @ ConfigProperty (name = "io.cryostat.reports.timeout" , defaultValue = "29000" )
8886 String timeoutMs ;
8987
90- @ ConfigProperty (name = "cryostat.storage.base-uri" )
91- Optional <String > storageBase ;
92-
9388 @ ConfigProperty (name = "cryostat.storage.auth-method" )
9489 Optional <String > storageAuthMethod ;
9590
@@ -154,21 +149,8 @@ public String getReportFromPresigned(RoutingContext ctx, @BeanParam PresignedFor
154149 long timeout = TimeUnit .MILLISECONDS .toNanos (Long .parseLong (timeoutMs ));
155150 long start = System .nanoTime ();
156151
157- if (storageBase .isEmpty ()) {
158- logger .error (
159- "Configuration property \" cryostat.storage.base-uri\" is unset, cannot handle"
160- + " presigned report requests!" );
161- throw new ServerErrorException (Response .Status .BAD_GATEWAY );
162- }
163-
164- UriBuilder uriBuilder =
165- UriBuilder .newInstance ()
166- .uri (new URI (storageBase .get ()))
167- .path (form .path )
168- .replaceQuery (form .query );
169- URI downloadUri = uriBuilder .build ();
170- logger .debugv ("Attempting to download presigned recording from {0}" , downloadUri );
171- HttpURLConnection httpConn = (HttpURLConnection ) downloadUri .toURL ().openConnection ();
152+ logger .debugv ("Attempting to download presigned recording from {0}" , form .uri );
153+ HttpURLConnection httpConn = (HttpURLConnection ) form .uri .toURL ().openConnection ();
172154 httpConn .setRequestMethod ("GET" );
173155 if (httpConn instanceof HttpsURLConnection ) {
174156 HttpsURLConnection httpsConn = (HttpsURLConnection ) httpConn ;
0 commit comments