当前位置:网站首页>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();
}
边栏推荐
- 如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
- `Thymeleaf ` template engine comprehensive analysis
- CONDA and pip commands
- ASCII code table extracted from tanhaoqiang's C program design (comparison table of common characters and ASCII codes)
- Generate binary tree according to preorder & inorder traversal [partition / generation / splicing of left subtree | root | right subtree]
- postgresql 之 ilist
- 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?
- 文本对比学习综述
- Development of B2B transaction collaborative management platform for kitchen and bathroom electrical appliance industry and optimization of enterprise inventory structure
- IDEA连接mysql自定义生成实体类代码
猜你喜欢

`Thymeleaf`模板引擎全面解析

专精特新“小巨人”再启动,“企业上云”数字赋能

Daily knowledge popularization

Method of inputting dots under letters in markdown/latex

Py之toad:toad的简介、安装、使用方法之详细攻略

leetcode:1504. Count the number of all 1 sub rectangles

Py's toad: a detailed introduction to toad, its installation and use

厨卫电器行业B2B交易协同管理平台开发,优化企业库存结构

常见的缺陷管理工具——禅道,从安装到使用手把手教会你

数商云:加强供应商管理,助推航空运输企业与供应商高效协同
随机推荐
IList of PostgreSQL
Successfully solved: selenium common. exceptions. SessionNotCreatedException: Message: session not created: This versi
【Pytorch】量化
The "little giant" specialized in special new products is restarted, and the "enterprise cloud" digital empowerment
Maximum path sum in binary tree [handle any subtree, then handle the whole tree]
Convolution kernel and characteristic graph visualization
数商云:加强供应商管理,助推航空运输企业与供应商高效协同
MES在流程和离散制造企业的15个差别(下)
10_ Those high-profile personal signatures
Virtual machines on the same distributed port group but different hosts cannot communicate with each other
June training (day 23) - dictionary tree
Linux Installation cenos7 MySQL - 8.0.26
leetcode 139. Word Break 单词拆分(中等)
MySQL log management, backup and recovery
box-sizing
A review of text contrastive learning
二造考生必看|巩固优选题库助力考生最后冲刺
怎样评价国产报表工具和BI软件
探索云原生数据库,纵观未来科技发展
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