package com.fdkankan.fyun.face; import com.fdkankan.fyun.config.FYunFileConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.IOException; import java.util.List; import java.util.Map; @Component public abstract class AbstractFYunFileService implements FYunFileServiceInterface { @Autowired public FYunFileConfig fYunFileConfig; @Override public void uploadFile(byte[] data, String remoteFilePath) throws Exception { uploadFile(fYunFileConfig.getBucket(), data, remoteFilePath); } @Override public void uploadFile(String filePath, String remoteFilePath) throws Exception { uploadFile(fYunFileConfig.getBucket(), filePath, remoteFilePath); } @Override public void uploadFileByCommand(String filePath, String remoteFilePath) throws Exception { uploadFileByCommand(fYunFileConfig.getBucket(), filePath, remoteFilePath); } @Override public void deleteFile(String remoteFilePath) throws IOException { deleteFile(fYunFileConfig.getBucket(), remoteFilePath); } @Override public void deleteFolder(String remoteFolderPath) throws Exception { deleteFolder(fYunFileConfig.getBucket(), remoteFolderPath); } @Override public void uploadMulFiles(Map filepaths) throws Exception { uploadMulFiles(fYunFileConfig.getBucket(), filepaths); } @Override public List listRemoteFiles(String sourcePath) throws Exception { return listRemoteFiles(fYunFileConfig.getBucket(), sourcePath); } @Override public void copyFileBetweenFyun(String sourcePath, String targetBucketName, String targetPath) throws Exception { copyFileBetweenFyun(fYunFileConfig.getBucket(),sourcePath, targetBucketName, targetPath); } @Override public void copyFilesBetweenFyun(String targetBucketName, Map pathMap) throws Exception { copyFilesBetweenFyun(fYunFileConfig.getBucket(),targetBucketName,pathMap); } @Override public String getFileContent(String remoteFilePath) throws Exception { return getFileContent(fYunFileConfig.getBucket(), remoteFilePath); } @Override public boolean fileExist(String objectName) throws Exception { return fileExist(fYunFileConfig.getBucket(), objectName); } @Override public void downloadFile(String remoteFilePath, String localPath) throws Exception { downloadFile(fYunFileConfig.getBucket(),remoteFilePath,localPath); } }