|
@@ -9,236 +9,270 @@ import java.util.Map;
|
|
@Component
|
|
@Component
|
|
public interface FYunFileServiceInterface {
|
|
public interface FYunFileServiceInterface {
|
|
|
|
|
|
- /**
|
|
|
|
- * 上传文件
|
|
|
|
- * @param bucket 目标bucket
|
|
|
|
- * @param data 上传的数据
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(String bucket, byte[] data, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传文件至系统默认bucket
|
|
|
|
- * @param data 上传的数据
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(byte[] data, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传本地文件
|
|
|
|
- * @param bucket 目标bucket
|
|
|
|
- * @param filePath 本地路径
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(String bucket, String filePath, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传本地文件至系统默认bucket
|
|
|
|
- * @param filePath 本地路径
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(String filePath, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传本地文件
|
|
|
|
- * @param bucket 目标bucket
|
|
|
|
- * @param filePath 本地路径
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(String bucket, String filePath, String remoteFilePath,Map<String,String> headers) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传本地文件至系统默认bucket
|
|
|
|
- * @param filePath 本地路径
|
|
|
|
- * @param remoteFilePath 上传后的文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadFile(String filePath, String remoteFilePath,Map<String,String> headers) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过本地脚本上传
|
|
|
|
- *
|
|
|
|
- * @param filePath
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- */
|
|
|
|
- void uploadFileByCommand(String bucket, String filePath, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过本地脚本上传至系统默认bucket
|
|
|
|
- *
|
|
|
|
- * @param filePath
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- */
|
|
|
|
- void uploadFileByCommand(String filePath, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 删除服务器文件
|
|
|
|
- * @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) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 删除系统默认bucket目录
|
|
|
|
- * @param remoteFolderPath
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- void deleteFolder(String remoteFolderPath) throws Exception;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传多个文件
|
|
|
|
- * @param bucket
|
|
|
|
- * @param filepaths :key 本地路径,value,服务器文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadMulFiles(String bucket, Map<String, String> filepaths) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 上传多个文件至系统默认bucket
|
|
|
|
- * @param filepaths :key 本地路径,value,服务器文件路径
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- void uploadMulFiles(Map<String, String> filepaths) throws Exception;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取文件列表
|
|
|
|
- * @param bucket
|
|
|
|
- * @param sourcePath
|
|
|
|
- * @return
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- List<String> listRemoteFiles(String bucket, String sourcePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取默认bucket文件列表
|
|
|
|
- * @param sourcePath
|
|
|
|
- * @return
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- List<String> listRemoteFiles(String sourcePath) throws Exception;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- * 拷贝目录
|
|
|
|
- * </p>
|
|
|
|
- *
|
|
|
|
- * @param sourcePath
|
|
|
|
- * @param targetPath
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/1/18
|
|
|
|
- **/
|
|
|
|
- void copyFileBetweenFyun(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- * 拷贝系统bucket目录至指定bucket
|
|
|
|
- * </p>
|
|
|
|
- *
|
|
|
|
- * @param sourcePath
|
|
|
|
- * @param targetPath
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/1/18
|
|
|
|
- **/
|
|
|
|
- void copyFileBetweenFyun(String sourcePath, String targetBucketName, String targetPath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- * 拷贝文件
|
|
|
|
- * </p>
|
|
|
|
- *
|
|
|
|
- * @param sourceBucketName
|
|
|
|
- * @param targetBucketName
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/1/18
|
|
|
|
- **/
|
|
|
|
- void copyFilesBetweenFyun(String sourceBucketName,String targetBucketName, Map<String,String> pathMap) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- * 拷贝系统bucket目录至指定bucket
|
|
|
|
- * </p>
|
|
|
|
- *
|
|
|
|
- * @param targetBucketName
|
|
|
|
- * @param pathMap
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/1/18
|
|
|
|
- **/
|
|
|
|
- void copyFilesBetweenFyun(String targetBucketName,Map<String,String> pathMap) throws Exception;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取文件内容
|
|
|
|
- *
|
|
|
|
- * @param bucketName
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- String getFileContent(String bucketName, String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取默认bucket内容
|
|
|
|
- *
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- String getFileContent(String remoteFilePath) throws Exception;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 判断文件是否存在
|
|
|
|
- *
|
|
|
|
- * @param objectName
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- boolean fileExist(String bucket, String objectName) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 判断默认bucket文件是否存在
|
|
|
|
- *
|
|
|
|
- * @param objectName
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- boolean fileExist(String objectName) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 从指定bucket下载文件
|
|
|
|
- *
|
|
|
|
- * @param bucket
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- * @param localPath
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public void downloadFile(String bucket, String remoteFilePath, String localPath) throws Exception;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 从系统默认bucket下载文件
|
|
|
|
- * @param remoteFilePath
|
|
|
|
- * @param localPath
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- public void downloadFile(String remoteFilePath, String localPath) throws Exception;
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 上传文件
|
|
|
|
+ *
|
|
|
|
+ * @param bucket 目标bucket
|
|
|
|
+ * @param data 上传的数据
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(String bucket, byte[] data, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传文件至系统默认bucket
|
|
|
|
+ *
|
|
|
|
+ * @param data 上传的数据
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(byte[] data, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传本地文件
|
|
|
|
+ *
|
|
|
|
+ * @param bucket 目标bucket
|
|
|
|
+ * @param filePath 本地路径
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(String bucket, String filePath, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传本地文件至系统默认bucket
|
|
|
|
+ *
|
|
|
|
+ * @param filePath 本地路径
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(String filePath, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传本地文件
|
|
|
|
+ *
|
|
|
|
+ * @param bucket 目标bucket
|
|
|
|
+ * @param filePath 本地路径
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(String bucket, String filePath, String remoteFilePath, Map<String, String> headers) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传本地文件至系统默认bucket
|
|
|
|
+ *
|
|
|
|
+ * @param filePath 本地路径
|
|
|
|
+ * @param remoteFilePath 上传后的文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadFile(String filePath, String remoteFilePath, Map<String, String> headers) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过本地脚本上传
|
|
|
|
+ *
|
|
|
|
+ * @param filePath
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ */
|
|
|
|
+ void uploadFileByCommand(String bucket, String filePath, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过本地脚本上传至系统默认bucket
|
|
|
|
+ *
|
|
|
|
+ * @param filePath
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ */
|
|
|
|
+ void uploadFileByCommand(String filePath, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除服务器文件
|
|
|
|
+ *
|
|
|
|
+ * @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) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除系统默认bucket目录
|
|
|
|
+ *
|
|
|
|
+ * @param remoteFolderPath
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ void deleteFolder(String remoteFolderPath) throws Exception;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传多个文件
|
|
|
|
+ *
|
|
|
|
+ * @param bucket
|
|
|
|
+ * @param filepaths :key 本地路径,value,服务器文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadMulFiles(String bucket, Map<String, String> filepaths) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上传多个文件至系统默认bucket
|
|
|
|
+ *
|
|
|
|
+ * @param filepaths :key 本地路径,value,服务器文件路径
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ void uploadMulFiles(Map<String, String> filepaths) throws Exception;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取文件列表
|
|
|
|
+ *
|
|
|
|
+ * @param bucket
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ List<String> listRemoteFiles(String bucket, String sourcePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取默认bucket文件列表
|
|
|
|
+ *
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ List<String> listRemoteFiles(String sourcePath) throws Exception;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ *在指定bucket 内拷贝文件
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @param targetPath
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFileInBucket(String bucket, String sourcePath, String targetPath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 在默认bucket 内拷贝文件
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @param targetPath
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFileInBucket(String sourcePath, String targetPath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ * 拷贝目录
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @param targetPath
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ * 拷贝系统bucket目录至指定bucket
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @param sourcePath
|
|
|
|
+ * @param targetPath
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFileBetweenBucket(String sourcePath, String targetBucketName, String targetPath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ * 拷贝文件
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @param sourceBucketName
|
|
|
|
+ * @param targetBucketName
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFilesBetweenBucket(String sourceBucketName, String targetBucketName, Map<String, String> pathMap) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * <p>
|
|
|
|
+ * 拷贝系统bucket目录至指定bucket
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @param targetBucketName
|
|
|
|
+ * @param pathMap
|
|
|
|
+ * @author dengsixing
|
|
|
|
+ * @date 2022/1/18
|
|
|
|
+ **/
|
|
|
|
+ void copyFilesBetweenBucket(String targetBucketName, Map<String, String> pathMap) throws Exception;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取文件内容
|
|
|
|
+ *
|
|
|
|
+ * @param bucketName
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ String getFileContent(String bucketName, String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取默认bucket内容
|
|
|
|
+ *
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ String getFileContent(String remoteFilePath) throws Exception;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断文件是否存在
|
|
|
|
+ *
|
|
|
|
+ * @param objectName
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ boolean fileExist(String bucket, String objectName) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断默认bucket文件是否存在
|
|
|
|
+ *
|
|
|
|
+ * @param objectName
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ boolean fileExist(String objectName) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 从指定bucket下载文件
|
|
|
|
+ *
|
|
|
|
+ * @param bucket
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ * @param localPath
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public void downloadFile(String bucket, String remoteFilePath, String localPath) throws Exception;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 从系统默认bucket下载文件
|
|
|
|
+ *
|
|
|
|
+ * @param remoteFilePath
|
|
|
|
+ * @param localPath
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public void downloadFile(String remoteFilePath, String localPath) throws Exception;
|
|
}
|
|
}
|