<a href="/article/family-solon-cloud-file">生态 / Solon Cloud File [传送]</a>

### 1、情况简介

分布式文件服务，也可叫云端文件服务。

* 主要通过 CloudFileService 接口进行适配
* 使用 CloudClient.file() 获取适配实例；
* 一般直接使用 CloudClient.file() 进行操作

目前适配有：local, aws-s3, file-s3, aliyun-oss, qiniu-kodo, minio 等

### 2、简单演示

配置
 
```yml
solon.cloud.aws.s3.file:
    bucket: world-data-dev
    endpoint: obs.cn-southwest-2.myhuaweicloud.com
    accessKey: iWeU7cOoPLR****
    secretKey: ZZIH6mT4VLAy68mVP8****
``` 

接口使用

```java
//写入
CloudClient.file().put("solon/user_"+user_id, new Media("{name:noear}"));

//读取
Media data = CloudClient.file().get("solon/user_"+user_id);

//删除
CloudClient.file().delete("solon/user_"+user_id);
```


**代码演示：**

[https://gitee.com/noear/solon-examples/tree/main/9.Solon-Cloud](https://gitee.com/noear/solon-examples/tree/main/9.Solon-Cloud)

