| | |
| | | |
| | | import com.dji.sample.media.model.CredentialsDTO; |
| | | |
| | | import java.io.InputStream; |
| | | import java.net.URL; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IOssService { |
| | | |
| | | String getOssType(); |
| | | |
| | | /** |
| | | * Get temporary credentials. |
| | | * |
| | | * @return |
| | | */ |
| | | CredentialsDTO 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); |
| | | |
| | | String putObject(String bucket, String objectKey, InputStream input); |
| | | |
| | | void createClient(); |
| | | } |