当前位置:网站首页>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();
}
边栏推荐
- ssh-keygen 配置无需每次输入密码
- SSH keygen configuration does not require entering a password every time
- 第八章 操作位和位串(四)
- `Thymeleaf ` template engine comprehensive analysis
- 10_那些格調很高的個性簽名
- 怎样评价国产报表工具和BI软件
- June training (day 23) - dictionary tree
- IDEA连接mysql自定义生成实体类代码
- API data interface for announcement of Hong Kong listed companies
- 数据库一些基本操作(提供了原数据库信息)
猜你喜欢

IDEA连接mysql自定义生成实体类代码

`Thymeleaf`模板引擎全面解析

leetcode.12 --- 整数转罗马数字

ASCII code table extracted from tanhaoqiang's C program design (comparison table of common characters and ASCII codes)

v-if 和 v-show 的区别

Defeat the binary tree!

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

Solution of channel management system for food and beverage industry: realize channel digital marketing layout

PgSQL queries the largest or smallest data of a field in a group

How to avoid placing duplicate orders
随机推荐
Brief discussion on the implementation framework of enterprise power Bi CI /cd
tongweb使用之端口冲突处理办法
日常知识科普
postgresql之List
Keras deep learning practice (11) -- visual neural network middle layer output
六石管理学:垃圾场效应:工作不管理,就会变成垃圾场
Return to new list
Unit contour creation method
简谈企业Power BI CI /CD 实施框架
[environment setup] zip volume compression
One article to get UDP and TCP high-frequency interview questions!
Keras深度学习实战(11)——可视化神经网络中间层输出
leetcode:1504. Count the number of all 1 sub rectangles
二叉树中最大路径和[处理好任意一颗子树,就处理好了整个树]
Bert-whitening 向量降维及使用
Daily knowledge popularization
R language plot visualization: use plot to visualize the training set and test set after data division, use different shape label representation, training set, test set, and display training and test
R语言构建回归模型诊断(正态性无效)、进行变量变换、使用car包中的powerTransform函数对目标变量进行Box-Cox变换(Box–Cox transform to normality)
Six stones Management: garbage dump effect: if you don't manage your work, you will become a garbage dump
c语言---18 函数(自定义函数)