Imageio.read returns null when Inputstream use jersey

Asked

Viewed 16 times

1

I have the following problem

I have the following service:

@PUT
@Path("/validateQRCode")
@Logging
@Permissions(allAllowed = true)
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
public Response validateQRCode(@FormDataParam("file") InputStream  file) throws Exception{
    return Response.ok().entity(qrCodeManager.validateQRCode(file)).build();
}

And I have the following class responsible for "business":

public QRCodeTO validateQRCode(InputStream  file) throws BusinessException {
        BufferedImage imagem = ImageIO.read(file);
        ....
}

The problem is that the object I receive for the service (file object is not null) when I use the Imageio method.read(file) it returns NULL... I searched N articles and all examples are based on this form of use.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.