awss3
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map; import javax.imageio.ImageIO; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component; import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.AccessControlList;
import com.amazonaws.services.s3.model.GroupGrantee;
import com.amazonaws.services.s3.model.Permission;
import com.amazonaws.services.s3.model.S3Object;
import org.springframework.web.multipart.MultipartFile; /**
* S3 接続取得.
*
* @param なし
* @return s3Client
*/
@SuppressWarnings("deprecation")
public AmazonS3Client getS3ClientConnection() {
//
// // 証書.
// AWSCredentials credentials = new BasicAWSCredentials(s3Accesskey, s3Secretkey);
// AmazonS3Client amazonS3Client = new AmazonS3Client(credentials);
// // S3所属地域
// Region region = Region.getRegion(Regions.AP_NORTHEAST_1);// Regions.US_EAST_1
// amazonS3Client.setRegion(region); BasicAWSCredentials creds = new BasicAWSCredentials(s3Accesskey, s3Secretkey);
ClientConfiguration config = new ClientConfiguration();
config.setProtocol(Protocol.HTTPS);
config.setProxyHost("172.16.200.15");
config.setProxyPort(80);
AmazonS3Client amazonS3Client = (AmazonS3Client) AmazonS3ClientBuilder.standard()
.withClientConfiguration(config)
.withRegion(Regions.AP_NORTHEAST_1)
.withCredentials(new AWSStaticCredentialsProvider(creds))
.build(); //AmazonS3Client amazonS3Client = (AmazonS3Client)(AmazonS3ClientBuilder.standard().build()); return amazonS3Client;
}
awss3的更多相关文章
- AWSS3异步等待上传成功返回结果
/// <summary> /// 流上传文件 /// </summary> /// <param name="data">流内容</pa ...
- python访问aws-S3服务
创建本地 AWS 凭证文件 登录 AWS 管理控制台 并通过以下网址打开 IAM 控制台 https://console.amazonaws.cn/iam/. 创建一个新用户,其权限仅限于您希望您的代 ...
- 阿里云服务器连接AWS-S3
1.找到一个路径下载 aws-cli (使用离线包安装) wget -P /usr/local/software https://s3.amazonaws.com/aws-cli/awscli-bu ...
- java操作AWS S3一些坑记录
1,aws sdk jar版本不一致问题 一开始我在pom.xml中只配置了如下aws-java-sdk-s3 <!-- https://mvnrepository.com/artifact/c ...
- GoAccess操作手册
名字 GoAccess - 可视化 Web 日志分析工具. 语法 goaccess [filename] [ options ... ] [-c][-M][-H][-q][-d][...] 描述 Go ...
- 首个springboot项目总结
项目说明:采用分布式架构的基于restfulApi的后端微服务api项目. 用到的技术栈:springboot.mybatis.swagger.eureka注册中心.gateway.awss3.doc ...
- crossdomain.xml解决跨域问题
特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...
- QingStor 对象存储架构设计及最佳实践
对象存储概念及特性 在介绍 QingStor️对象存储内部的的架构和设计原理之前,我们首先来了解一下对象存储的概念,也就是从外部视角看,对象存储有什么特性,我们应该如何使用. 对象存储本质上是一款存储 ...
- Solon Cloud 分布式开发套件清单与快速概览
Solon Cloud 是一系列的接口标准和配置规范.Solon Cloud 为常见的分布式系统模式提供了一种简单且方便的编程模式,帮助开发人员构建有弹性的.可靠的.协调的应用程序.Solon Clo ...
随机推荐
- vue.js_01_vue.js的入门
1.什么是Vue.js Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架(React除了开发网站,还可以开发手机App, Vue语法也是可以用于进行手机App开发的,需要借助于 ...
- 移动端网站如何开发(电脑端网站到手机端网站我们需要在html代码中添加哪个meta标签)
移动端网站如何开发(电脑端网站到手机端网站我们需要在html代码中添加哪个meta标签) 一.总结 一句话总结: 添加viewport标签:meta name="viewport" ...
- Python学习笔记之常用函数及说明
Python学习笔记之常用函数及说明 俗话说"好记性不如烂笔头",老祖宗们几千年总结出来的东西还是有些道理的,所以,常用的东西也要记下来,不记不知道,一记吓一跳,乖乖,函数咋这么多 ...
- pycharm 安装与激活
---恢复内容开始--- 环境:Windows 专业版 1.下载安装 1.到官网下载专业版(专业版功能更全(但要激活码),社区版免费) 2.下载完后双击.exe 文件进行安装 NEXT 下一步 NEX ...
- PAT甲级——A1057 Stack
Stack is one of the most fundamental data structures, which is based on the principle of Last In Fir ...
- 关于mapreduce 开发环境部署和jar包拷贝问题
1.mapreduce开发应当在linux里面的eclipse不然容易出现问题. 2.把eclipse拷贝到linux环境中,然后需要拷贝hadoop-eclipse-plugin-2.3.0.jar ...
- HDFS 名称节点的启动
- String and Times
String and Times 时间限制: 1 Sec 内存限制: 128 MB 题目描述 Now you have a string consists of uppercase letters, ...
- 一个网页登陆界面写30多个测试Case——测试之道
转自博文:http://www.cnblogs.com/I-am-Betty/p/3566411.html 具体需求: 有一个登陆页面, (假如上面有2个textbox, 一个提交按钮. 请针对这个页 ...
- 前端(jQuery)(9)-- jQuery菜单
1.垂直菜单布局 2.垂直菜单实现 <!DOCTYPE html> <html lang="en"> <head> <meta chars ...