io.github.ncc0706.oss.IOssService Maven / Gradle / Ivy
The newest version!
package io.github.ncc0706.oss;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Set;
/**
* Created by IntelliJ IDEA.
*
* @author NiuYuxian
* @since 2024-01-12 20:59:00
*/
public interface IOssService {
/**
* 判断 bucket 是否存在
*
* @param bucket
* @return
*/
boolean exitsBucket(String bucket);
/**
* 创建 bucket
*
* @param bucket
*/
void createBucket(String bucket);
/**
* 删除 bucket
*
* @param bucket
*/
void deleteBucket(String bucket);
void putObjectFromBytes(String bucket, String key, byte[] bytes);
void putObjectFile(String bucket, String key, File file);
void putObjectFromInputStream(String bucket, String key, InputStream inputStream);
byte[] getObjectAsBytes(String bucket, String key);
InputStream getObjectAsInputStream(String bucket, String key);
/**
* 删除 object
*
* @param bucket
* @param key
*/
void deleteObject(String bucket, String key);
void deleteObject(String bucket, Set keySet);
/**
* 复制 object
*
* @param sourceBucket
* @param sourceKey
* @param destinationBucket
* @param destinationKey
*/
void copyBucketObject(String sourceBucket, String sourceKey, String destinationBucket, String destinationKey);
void moveBucketObject(String sourceBucket, String sourceKey, String destinationBucket, String destinationKey);
void rename(String bucket, String sourceKey, String destinationKey);
List listBucketObjects(String bucket);
/**
* 预览 object
*
* @param bucket
* @param key
* @return
*/
String previewUrl(String bucket, String key);
String previewUrl(String bucket, String key, long minutes);
}