Download a file from s3url

I am having an dowload button and clicking that internally an a file is created and saved to s3 and s3 url is returned
So i have s3url with me. How can i download it as part of the method only
Attaching the method

private void createFileDownloadBtn() {
    paceCM360ReportTable.addGeneratedColumn("Download", row -> {
        Button button = uiComponents.create(Button.NAME);
        button.setCaption("Download");
        button.setStyleName("custom-buttons");
        button.addClickListener(clickEvent -> {
            try {
                String sampleS3Url = paceCM360Controller.getSampleFileS3Url(row.getId());
                downloader.download();
            } catch (JsonProcessingException e) {
                throw new RuntimeException(e);
            }
        });
        return button;
    });
}

Well. Firstly we don’t know how you saved the file in s3.
Is it AWS File Storage Add-on? Or some other methods? Most likely you are using amazon S3Client

Then something like that:

            GetObjectRequest getObjectRequest = GetObjectRequest.builder()
                    .bucket(bucket)
                    .key(sampleS3Url)
                    .build();
            InputStream is = s3Client.getObject(getObjectRequest, ResponseTransformer.toInputStream());

?