k94314517
2025-06-19 aaf48b095f3f5bf379adce3644dfd96f8d8a49d8
server/service/src/main/java/com/doumee/core/utils/aliyun/ALiYunUtil.java
@@ -1,9 +1,14 @@
package com.doumee.core.utils.aliyun;
import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.*;
import com.aliyun.sdk.service.cloudauth20190307.AsyncClient;
import com.aliyun.sdk.service.cloudauth20190307.models.Id2MetaVerifyRequest;
import com.aliyun.sdk.service.cloudauth20190307.models.Id2MetaVerifyResponse;
import com.doumee.core.utils.FileDigest;
import java.io.File;
import java.io.FileInputStream;
@@ -14,6 +19,10 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import com.google.gson.Gson;
import darabonba.core.client.ClientOverrideConfiguration;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.multipart.MultipartFile;
@@ -435,17 +444,17 @@
        return filename;
    }
    public static void main(String[] args) throws OSSException,
            ClientException, IOException {
        ALiYunUtil aLiYunUtil = new ALiYunUtil("", "uc4nnpsqep1i9fijqr37nokh",
                "/rp41xCx/XdGEVCptdH6v7xpc9w=");
        // aLiYunUtil.uploadObject("pongto", "work/li2.txt", "D://哈.txt",
        // ".html,.html text/html");D://装机软件/办公学习
        // aLiYunUtil.partUploadObject("pongto", "work/ps.exe",
        // "D://装机软件/办公学习/Adobe_Illustrator_CS6_XiaZaiBa.exe",
        // ".html,.html text/html");
        // aLiYunUtil.deleteBucket("pongto");
    }
//    public static void main(String[] args) throws OSSException,
//            ClientException, IOException {
//        ALiYunUtil aLiYunUtil = new ALiYunUtil("", "uc4nnpsqep1i9fijqr37nokh",
//                "/rp41xCx/XdGEVCptdH6v7xpc9w=");
//        // aLiYunUtil.uploadObject("pongto", "work/li2.txt", "D://哈.txt",
//        // ".html,.html text/html");D://装机软件/办公学习
//        // aLiYunUtil.partUploadObject("pongto", "work/ps.exe",
//        // "D://装机软件/办公学习/Adobe_Illustrator_CS6_XiaZaiBa.exe",
//        // ".html,.html text/html");
//        // aLiYunUtil.deleteBucket("pongto");
//    }
    /**
     * 上传网络文件
@@ -557,4 +566,9 @@
    }
}