OBS 对象存储初探:Amazon S3 简单使用

Java Main

Work with Amazon S3 objects
Amazon S3 Examples Using the AWS SDK for Java
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/s3/src/main/java/com/example/s3
官方代码示例
官方代码示例S3

Spring Boot 集成

集成需要的依赖 spring-cloud-starter-aws
官方Spring项目 org.springframework.cloud:spring-cloud-starter-aws
https://cloud.spring.io/spring-cloud-aws/reference/html/##using-amazon-web-services
https://cloud.spring.io/spring-cloud-aws/2.1.x/multi/multi_spring-cloud-aws.html

参考这里就够了:
Getting Started with AWS S3 and Spring Boot
GitHub 代码示例
需要注意的是S3的参数配置:
两种办法:一种是在yml里面直接写ak,sk,另一种是 ~/.aws/credentials
相见官方文档ak,sk 配置办法

cloud:
  aws:
    region:
      static: us-west-1
    stack:
      auto: false
    credentials:
      profile-name: default

调用API的类,参考:S3Repository.java

其他参考

S3
https://s3.console.aws.amazon.com/s3/home?region=ap-southeast-1#
S3 文档
https://aws.amazon.com/cn/s3/
https://aws.amazon.com/cn/s3/developer-resources/?nc=sn&loc=6
文档
https://aws.amazon.com/cn/getting-started/

https://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=S3%20Java
Work with Amazon S3 objects
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-s3-objects.html
Amazon S3 Examples Using the AWS SDK for Java
https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3.html

开发文档
https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/developing-s3.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html
https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/Welcome.html
Guide
https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/Welcome.html
API
https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/API/Welcome.html

Spring Boot 集成
https://www.baeldung.com/aws-s3-java
https://github.com/eugenp/tutorials/tree/master/aws/src/main/java/com/baeldung/s3

Getting Started with AWS S3 and Spring Boot
build a custom file-sharing application
https://reflectoring.io/spring-boot-s3/
https://github.com/thombergs/code-examples/tree/master/aws/s3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值