an other test to validate query

This commit is contained in:
Edouard DUPIN 2022-05-24 00:17:30 +02:00
parent 42e3fde2eb
commit 8a12abb164
2 changed files with 10 additions and 5 deletions

View File

@ -83,8 +83,13 @@ public class AuthenticationFilter implements ContainerRequestFilter {
System.out.println(" param: " + item.getKey() + " ==>" + item.getValue());
}
System.out.println(" -------------------------------");
List<PathSegment> quaryparam = requestContext.getUriInfo().getPathSegments();
for (final PathSegment item: quaryparam) {
MultivaluedMap<String, String> quaryparam = requestContext.getUriInfo().getQueryParameters();
for (Entry<String, List<String>> item: quaryparam.entrySet()) {
System.out.println(" query: " + item.getKey() + " ==>" + item.getValue());
}
System.out.println(" -------------------------------");
List<PathSegment> segments = requestContext.getUriInfo().getPathSegments();
for (final PathSegment item: segments) {
System.out.println(" query: " + item.getPath() + " ==>" + item.getMatrixParameters());
}
System.out.println(" -------------------------------");

View File

@ -350,7 +350,7 @@ public class DataResource {
@PermitTokenInURI
@RolesAllowed("USER")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response retriveDataId(@Context SecurityContext sc, @HeaderParam("Range") String range, @PathParam("id") Long id) throws Exception {
public Response retriveDataId(@Context SecurityContext sc, @QueryParam("p") String token, @HeaderParam("Range") String range, @PathParam("id") Long id) throws Exception {
GenericContext gc = (GenericContext) sc.getUserPrincipal();
System.out.println("===================================================");
System.out.println("== DATA retriveDataId ? " + (gc==null?"null":gc.user));
@ -370,7 +370,7 @@ public class DataResource {
@RolesAllowed("USER")
@PermitTokenInURI
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response retriveDataThumbnailId(@Context SecurityContext sc, @HeaderParam("Range") String range, @PathParam("id") Long id) throws Exception {
public Response retriveDataThumbnailId(@Context SecurityContext sc, @QueryParam("p") String token, @HeaderParam("Range") String range, @PathParam("id") Long id) throws Exception {
GenericContext gc = (GenericContext) sc.getUserPrincipal();
System.out.println("===================================================");
System.out.println("== DATA retriveDataThumbnailId ? " + (gc==null?"null":gc.user));
@ -418,7 +418,7 @@ public class DataResource {
@PermitTokenInURI
@RolesAllowed("USER")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response retriveDataFull(@Context SecurityContext sc, @HeaderParam("Range") String range, @PathParam("id") Long id, @PathParam("name") String name) throws Exception {
public Response retriveDataFull(@Context SecurityContext sc, @QueryParam("p") String token, @HeaderParam("Range") String range, @PathParam("id") Long id, @PathParam("name") String name) throws Exception {
GenericContext gc = (GenericContext) sc.getUserPrincipal();
System.out.println("===================================================");
System.out.println("== DATA retriveDataFull ? " + (gc==null?"null":gc.user));