Are you trying to upload your directory structure to s3?
Then you can try this with the CLI:
aws s3 sync . s3://mybucket
https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
You could also achieve this programatically:
TransferManager tm = new TransferManager(new ProfileCredentialsProvider());
MultipleFileUpload upload = tm.uploadDirectory(bucket, folder, new File(filePath), true);
try
{
// Or you can block and wait for the upload to finish
upload.waitForCompletion();
LOGGER.debug("Upload complete.", bucket, folder);
}
catch (AmazonClientException amazonClientException)
{
LOGGER.error("Unable to upload file, upload was aborted.", amazonClientException);
throw amazonClientException;
}
https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-transfermanager.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.