当前位置:网站首页>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();
}
边栏推荐
猜你喜欢

GO语言-goroutine协程的使用

Idea connection MySQL custom generated entity class code

文本对比学习综述

How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup

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

SaaS management system solution of smart Park: enabling the park to realize information and digital management

常见的单例模式&简单工厂

`Thymeleaf ` template engine comprehensive analysis

leetcode:1504. 统计全 1 子矩形的个数

Linux 安装 CenOS7 MySQL - 8.0.26
随机推荐
MySQL title
Research on MySQL composite index
MES在流程和离散制造企业的15个差别(下)
怎样评价国产报表工具和BI软件
探索云原生数据库,纵观未来科技发展
puzzle(016.2)指画星河
数商云:加强供应商管理,助推航空运输企业与供应商高效协同
作为一名开发者,对你影响最深的书籍是哪一本?
[deep learning] storage form of nchw, nhwc and chwn format data
IDEA 插件 Material Theme UI收费后的办法
如何避免下重复订单
R language plot visualization: the visualization model creates a grid in the classification contour (contour) and meshgrid of the entire data space, in which the distance between each point is determi
Go language - use of goroutine coroutine
postgresql之List
Detailed explanation of redis data types
How to implement redis cache of highly paid programmers & interview questions series 115? How do I find a hot key? What are the possible problems with caching?
Explore cloud native databases and take a broad view of future technological development
【比特熊故事汇】6月MVP英雄故事|技术实践碰撞境界思维
laravel 8 实现Auth登录
c语言---18 函数(自定义函数)