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 ...
随机推荐
- Django项目:CRM(客户关系管理系统)--59--49PerfectCRM实现CRM客户报名流程学生合同表单验证
# sales_views.py # ————————47PerfectCRM实现CRM客户报名流程———————— from django.db import IntegrityError #主动捕 ...
- PAT甲级——A1020 Tree Traversals
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and i ...
- java监控文件夹下的文件变化使用jnotify
https://blog.csdn.net/codepython/article/details/42341243?utm_source=blogxgwz1 使用jnotify https://blo ...
- Linux TC的ifb原理以及ingress流控-转
原文:http://www.xuebuyuan.com/2961303.html 首先贴上Linux内核的ifb.c的文件头注释: The purpose of this driver is ...
- Docker(三)安装Mysql
1.安装Mysql,以及常见的错误解决方法 https://blog.csdn.net/qq_19348391/article/details/82998391 2.使用SQLyog或者Navicat ...
- UVa 12034 Race 递推?
一开始是想排列组合做的,排列组合感觉确实可以推出公式,但是复杂度嘛.. dp[i][j]表示有i只马,j个名次的方法数,显然j<=i,然后递推公式就很好写了,一只马新加进来要么与任意一个名次的马 ...
- Django项目:CRM(客户关系管理系统)--52--43PerfectCRM实现AJAX全局账号登陆
# gbacc_ajax_urls.py # ————————42PerfectCRM实现AJAX全局账号注册———————— from django.conf.urls import url fro ...
- Codeforces 222B 数组行列交换操作
/*做完这题发现自己好水,太伤人了.... 不过还是学到一些,如果直接暴力模拟的话肯定是TLM.. 所以要用虚拟数组来分别保存当前数组的每行没列在初始数组中的位置...*/ #include<c ...
- poj 1144 Network(割点 入门)
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10907 Accepted: 5042 Descript ...
- java并发系列(三)-----ReentrantLock(重入锁)功能详解和应用演示
1. ReentrantLock简介 jdk中独占锁的实现除了使用关键字synchronized外,还可以使用ReentrantLock.虽然在性能上ReentrantLock和synchronize ...