Skip to content

Commit

Permalink
remove last usages
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Apr 24, 2024
1 parent 465ef49 commit 6416764
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
14 changes: 1 addition & 13 deletions src/main/java/io/cryostat/graphql/GraphQL.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriInfo;
import org.apache.hc.core5.net.URIBuilder;
import org.jboss.resteasy.reactive.RestResponse;

@Path("")
Expand All @@ -33,22 +32,11 @@ public class GraphQL {
@Path("/api/v2.2/graphql")
@RolesAllowed("write")
public Response redirectGet(UriInfo info) throws Exception {
var uriBuilder = new URIBuilder();
info.getQueryParameters()
.entrySet()
.forEach(
entry -> {
if (entry.getValue().size() != 1) {
return;
}
uriBuilder.addParameter(entry.getKey(), entry.getValue().get(0));
});
return Response.status(RestResponse.Status.PERMANENT_REDIRECT)
.location(
URI.create(
String.format(
"/api/v3/graphql?%s",
String.join("&", uriBuilder.build().getRawQuery()))))
"/api/v3/graphql?%s", info.getRequestUri().getRawQuery())))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.ws.rs.core.MediaType;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hc.core5.http.ContentType;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
import org.xml.sax.SAXException;
Expand Down Expand Up @@ -191,7 +191,7 @@ public ProbeTemplate addTemplate(InputStream stream, String fileName)
PutObjectRequest.builder()
.bucket(bucket)
.key(fileName)
.contentType(ContentType.APPLICATION_XML.getMimeType())
.contentType(MediaType.APPLICATION_XML)
.tagging(
createTemplateTagging(
fileName,
Expand Down

0 comments on commit 6416764

Please sign in to comment.