wangmengmeng
2024-12-24 24432a361d5c6bd6f3d8c008693e9f1155d62517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.dji.sample.component.oss.service;
 
import com.dji.sdk.cloudapi.storage.CredentialsToken;
import com.dji.sdk.cloudapi.storage.OssTypeEnum;
 
import java.io.InputStream;
import java.net.URL;
 
/**
 * @author sean
 * @version 0.3
 * @date 2021/12/23
 */
public interface IOssService {
 
    OssTypeEnum getOssType();
 
    /**
     * Get temporary credentials.
     * @return
     */
    CredentialsToken getCredentials();
 
    /**
     * Get the address of the object based on the bucket name and the object name.
     * @param bucket    bucket name
     * @param objectKey object name
     * @return download link
     */
    URL getObjectUrl(String bucket, String objectKey);
 
    /**
     * Deletes the object in the storage bucket.
     * @param bucket
     * @param objectKey
     * @return
     */
    Boolean deleteObject(String bucket, String objectKey);
 
    /**
     * Get the contents of an object.
     * @param bucket
     * @param objectKey
     * @return
     */
    InputStream getObject(String bucket, String objectKey);
 
    void putObject(String bucket, String objectKey, InputStream input);
 
    void createClient();
}