当前位置:网站首页>Alibaba OSS object storage service
Alibaba OSS object storage service
2022-06-24 14:25:00 【Knowing is knowing】
Alibaba cloud object storage service (Object Storage Service, abbreviation OSS)
Refer to Ali OSS Object storage services quick start documentation :
1. Introduce dependencies
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
</dependency>
2.OSS Console create storage space
Uploading files (Object) To OSS Before , You need to create a storage space for storing files (Bucket)
3. Upload files to by streaming upload OSS
See product documentation
4. Stream download from OSS Download the file
See product documentation
5. Transfer object 、 Parse object
① Put the object parse by JSON Upload
Dog dog = new Dog(" Xiao Huang ", 2);
String jsonStr = JSON.toJSONString(dog);
ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(jsonStr.getBytes()));
② download JSON and parse As object
OSSObject ossObject = ossClient.getObject(bucketName, objectName);
InputStream content = ossObject.getObjectContent();
if (content != null) {
Dog dog = JSON.parseObject(content, Dog.class);
System.out.println(dog.getName() + "-" + dog.getAge());
content.close();
}
边栏推荐
- Bert-whitening 向量降维及使用
- June training (day 23) - dictionary tree
- SSH keygen configuration does not require entering a password every time
- `Thymeleaf ` template engine comprehensive analysis
- leetcode:1504. Count the number of all 1 sub rectangles
- Overview of SAP marketing cloud functions (IV)
- How to avoid placing duplicate orders
- The "little giant" specialized in special new products is restarted, and the "enterprise cloud" digital empowerment
- 【ansible问题处理】远程执行用户环境变量加载问题
- [pytoch] quantification
猜你喜欢

Go语言三个高效编程的技巧

Three efficient programming skills of go language

Development of B2B transaction collaborative management platform for kitchen and bathroom electrical appliance industry and optimization of enterprise inventory structure

Keras deep learning practice (11) -- visual neural network middle layer output

STM32F1与STM32CubeIDE编程实例-WS2812B全彩LED驱动(基于SPI+DMA)

pgsql查询分组中某个字段最大或者最小的一条数据

【无标题】

食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局

Go language - use of goroutine coroutine

Successfully solved: selenium common. exceptions. SessionNotCreatedException: Message: session not created: This versi
随机推荐
R language constructs regression model diagnosis (normality is invalid), performs variable transformation, and uses powertransform function in car package to perform box Cox transform to normality on
June training (day 23) - dictionary tree
The "little giant" specialized in special new products is restarted, and the "enterprise cloud" digital empowerment
厨卫电器行业B2B交易协同管理平台开发,优化企业库存结构
Three efficient programming skills of go language
Maximum path sum in binary tree [handle any subtree, then handle the whole tree]
R语言plotly可视化:使用plotly可视化数据划分后的训练集和测试集、使用不同的形状标签表征、训练集、测试集、以及数据集的分类标签(Display training and test split
动作捕捉系统用于地下隧道移动机器人定位与建图
文本对比学习综述
鲲鹏arm服务器编译安装PaddlePaddle
常见的缺陷管理工具——禅道,从安装到使用手把手教会你
C language ---18 function (user-defined function)
GO语言-goroutine协程的使用
数商云:加强供应商管理,助推航空运输企业与供应商高效协同
同样是初级测试工程师,为啥他薪资高?会这几点面试必定出彩
How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup
Development of B2B transaction collaborative management platform for kitchen and bathroom electrical appliance industry and optimization of enterprise inventory structure
不要小看了积分商城,它的作用可以很大
postgresql 之 ilist
R语言plotly可视化:可视化模型在整个数据空间的分类轮廓线(等高线)、meshgrid创建一个网格,其中每个点之间的距离由mesh_size变量表示、使用不同的形状标签表征、训练、测试及分类标签