Hi every body.
Recently I have a project work with S3 and Glacier.
I can create S3 bucket, upload to s3 and Glacier vault. Now I'm finding a way to archive it to Glacier but not success.
I have tried using UploadArchiveRequest and read file from url but I get stuck
URL u = new URL(path);// path is a url of object on s3 InputStream is = u.openStream(); byte body = IOUtils.toByteArray(is); is.read(body); UploadArchiveRequest request = new UploadArchiveRequest() .withVaultName(vaultName) .withChecksum(TreeHashGenerator.calculateTreeHash(is)) .withBody(new ByteArrayInputStream(body)) .withContentLength((long) body.length); UploadArchiveResult result = glacier.uploadArchive(request); return result.getArchiveId(); # This got error below: com.amazonaws.AmazonClientException: Unable to compute hash
Is it correct way to create archive to glacier?
I can't find more information about this. Only have video but it's make on amazon website. Not by code.
If anyone has experienced please help me.
Thanks a lot.