如何使用Java SDK将目录与AWS S3同步? [英] How to sync directory with AWS S3 using Java SDK?

查看:182
本文介绍了如何使用Java SDK将目录与AWS S3同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我偶然发现了这篇文章 https:// aws .amazon.com / blogs / developer / syncing-data-with-amazon-s3 / 让我了解了uploadDirectory()方法。该博客指出:这一小段代码将本地目录的内容与Amazon S3存储桶中的内容进行比较,并仅传输已更改的文件。这似乎并不完全正确,因为它似乎总是传输给定目录中的每个文件而不是仅更改的文件。

I came across this article https://aws.amazon.com/blogs/developer/syncing-data-with-amazon-s3/ which made me aware of the uploadDirectory() method. The blog states: "This small bit of code compares the contents of the local directory to the contents in the Amazon S3 bucket and only transfer files that have changed." This does not seem to be entirely correct since it appears to always transfer every file in a given directory as opposed to only the files that have changed.

我能够做到我想用AWSCLI的s3 sync命令,但目标是能够使用Java SDK进行同步。是否可以使用Java SDK进行相同类型的同步?

I was able to do what I wanted using AWSCLI's s3 sync command, however the goal is to be able to do this syncing using the Java SDK. Is it possible to do this same type of sync using the Java SDK?

推荐答案

我发现它,它是 TransferManage。 uploadDirectory()

I've found it, it is TransferManage.uploadDirectory()

这篇关于如何使用Java SDK将目录与AWS S3同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆