Skip to content

xiaohaoo/cloud-storage-master

Repository files navigation

CloudStorageMaster

云存储工具服务(Cloud Storage Service),目前仅支持阿里云OSS

功能

  • 上传文件
  • 下载文件
  • 删除文件
  • 文件断存在

使用方法

  • groovy
implementation platform("com.xiaohaoo:xiaohao-dependencies:1.0.1")
implementation "com.xiaohaoo:cloud-storage-master"
  • kotlin
implementation(platform("com.xiaohaoo.dependencies:xiaohao-dependencies:1.0.1"))
implementation("com.xiaohaoo:cloud-storage-master")

使用方法

public class Main {
    public static void main(String[] args) {
        String accessKeyId = "accessKeyId";
        String accessKeySecret = "accessKeySecret";
        String endpoint = "https://endpoint";
        CloudStorageFactory cloudStorageFactory = new AliyunCloudStorageFactory(accessKeyId, accessKeySecret, endpoint);
        CloudStorageService cloudStorageService = new CloudStorageService(cloudStorageFactory);
        cloudStorageService.upload(bucketName, objectName, inputStream);
    }
}

Authors

License

GNU Affero General Public License v3.0

About

云存储相关工具类,包含文件的上传、下载等。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages