package com.fdkankan.fyun.face; import org.springframework.stereotype.Component; import java.io.IOException; import java.util.List; import java.util.Map; @Component public interface FYunFileServiceInterface { String getFyunType(); /** * 上传文件 * * @param bucket 目标bucket * @param data 上传的数据 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(String bucket, byte[] data, String remoteFilePath) ; /** * 上传文件至系统默认bucket * * @param data 上传的数据 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(byte[] data, String remoteFilePath) ; /** * 上传本地文件 * * @param bucket 目标bucket * @param filePath 本地路径 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(String bucket, String filePath, String remoteFilePath) ; /** * 上传本地文件至系统默认bucket * * @param filePath 本地路径 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(String filePath, String remoteFilePath) ; /** * 上传本地文件 * * @param bucket 目标bucket * @param filePath 本地路径 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(String bucket, String filePath, String remoteFilePath, Map headers) ; /** * 上传本地文件至系统默认bucket * * @param filePath 本地路径 * @param remoteFilePath 上传后的文件路径 * @ */ void uploadFile(String filePath, String remoteFilePath, Map headers) ; /** * 通过本地脚本上传 * * @param filePath * @param remoteFilePath */ void uploadFileByCommand(String bucket, String filePath, String remoteFilePath) ; /** * 通过本地脚本上传至系统默认bucket * * @param filePath * @param remoteFilePath */ void uploadFileByCommand(String filePath, String remoteFilePath) ; /** * 删除服务器文件 * * @param bucket * @param remoteFilePath * @throws IOException */ void deleteFile(String bucket, String remoteFilePath) throws IOException; /** * 删除系统默认bucket服务器文件 * * @param remoteFilePath * @throws IOException */ void deleteFile(String remoteFilePath) throws IOException; /** * 删除目录 * * @param bucket * @param remoteFolderPath * @return */ void deleteFolder(String bucket, String remoteFolderPath) ; /** * 删除系统默认bucket目录 * * @param remoteFolderPath * @return */ void deleteFolder(String remoteFolderPath) ; /** * 上传多个文件 * * @param bucket * @param filepaths :key 本地路径,value,服务器文件路径 * @ */ void uploadMulFiles(String bucket, Map filepaths) ; /** * 上传多个文件至系统默认bucket * * @param filepaths :key 本地路径,value,服务器文件路径 * @ */ void uploadMulFiles(Map filepaths) ; /** * 获取文件列表 * * @param bucket * @param sourcePath * @return * @ */ List listRemoteFiles(String bucket, String sourcePath) ; /** * 获取默认bucket文件列表 * * @param sourcePath * @return * @ */ List listRemoteFiles(String sourcePath) ; /** * *在指定bucket 内拷贝文件 * @param sourcePath * @param targetPath * @author dengsixing * @date 2022/1/18 **/ void copyFileInBucket(String bucket, String sourcePath, String targetPath) ; /** * 在默认bucket 内拷贝文件 * @param sourcePath * @param targetPath * @author dengsixing * @date 2022/1/18 **/ void copyFileInBucket(String sourcePath, String targetPath) ; /** *

* 拷贝目录 *

* * @param sourcePath * @param targetPath * @author dengsixing * @date 2022/1/18 **/ void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) ; /** *

* 拷贝系统bucket目录至指定bucket *

* * @param sourcePath * @param targetPath * @author dengsixing * @date 2022/1/18 **/ void copyFileBetweenBucket(String sourcePath, String targetBucketName, String targetPath) ; /** *

* 拷贝文件 *

* * @param sourceBucketName * @param targetBucketName * @author dengsixing * @date 2022/1/18 **/ void copyFilesBetweenBucket(String sourceBucketName, String targetBucketName, Map pathMap) ; /** *

* 拷贝系统bucket目录至指定bucket *

* * @param targetBucketName * @param pathMap * @author dengsixing * @date 2022/1/18 **/ void copyFilesBetweenBucket(String targetBucketName, Map pathMap) ; /** * 获取文件内容 * * @param bucketName * @param remoteFilePath * @return */ String getFileContent(String bucketName, String remoteFilePath) ; /** * 获取默认bucket内容 * * @param remoteFilePath * @return */ String getFileContent(String remoteFilePath) ; /** * 判断文件是否存在 * * @param objectName * @return */ boolean fileExist(String bucket, String objectName) ; /** * 判断默认bucket文件是否存在 * * @param objectName * @return */ boolean fileExist(String objectName) ; /** * 从指定bucket下载文件 * * @param bucket * @param remoteFilePath * @param localPath * @return */ public void downloadFile(String bucket, String remoteFilePath, String localPath) ; /** * 从系统默认bucket下载文件 * * @param remoteFilePath * @param localPath * @ */ public void downloadFile(String remoteFilePath, String localPath) ; }