123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- 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<String, String> headers) ;
- /**
- * 上传本地文件至系统默认bucket
- *
- * @param filePath 本地路径
- * @param remoteFilePath 上传后的文件路径
- * @
- */
- void uploadFile(String filePath, String remoteFilePath, Map<String, String> 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<String, String> filepaths) ;
- /**
- * 上传多个文件至系统默认bucket
- *
- * @param filepaths :key 本地路径,value,服务器文件路径
- * @
- */
- void uploadMulFiles(Map<String, String> filepaths) ;
- /**
- * 获取文件列表
- *
- * @param bucket
- * @param sourcePath
- * @return
- * @
- */
- List<String> listRemoteFiles(String bucket, String sourcePath) ;
- /**
- * 获取默认bucket文件列表
- *
- * @param sourcePath
- * @return
- * @
- */
- List<String> 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) ;
- /**
- * <p>
- * 拷贝目录
- * </p>
- *
- * @param sourcePath
- * @param targetPath
- * @author dengsixing
- * @date 2022/1/18
- **/
- void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) ;
- /**
- * <p>
- * 拷贝系统bucket目录至指定bucket
- * </p>
- *
- * @param sourcePath
- * @param targetPath
- * @author dengsixing
- * @date 2022/1/18
- **/
- void copyFileBetweenBucket(String sourcePath, String targetBucketName, String targetPath) ;
- /**
- * <p>
- * 拷贝文件
- * </p>
- *
- * @param sourceBucketName
- * @param targetBucketName
- * @author dengsixing
- * @date 2022/1/18
- **/
- void copyFilesBetweenBucket(String sourceBucketName, String targetBucketName, Map<String, String> pathMap) ;
- /**
- * <p>
- * 拷贝系统bucket目录至指定bucket
- * </p>
- *
- * @param targetBucketName
- * @param pathMap
- * @author dengsixing
- * @date 2022/1/18
- **/
- void copyFilesBetweenBucket(String targetBucketName, Map<String, String> 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) ;
- }
|