|
@@ -144,6 +144,19 @@ public class S3FileService extends AbstractFYunFileService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public void downloadByCommand(String bucket, String filePath, String remoteFilePath, boolean isDir) {
|
|
|
+ try {
|
|
|
+ String optType = isDir ? "folder" : "file";
|
|
|
+ String command = String.format(fYunConstants.DOWNLOAD_SH, bucket, remoteFilePath, filePath, FYunTypeEnum.AWS.code(), optType);
|
|
|
+ log.info("开始下载文件, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
|
+ callshell(command);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("上传文件失败, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void deleteFile(String bucket, String remoteFilePath){
|
|
|
if (remoteFilePath.startsWith("/")) {
|
|
|
remoteFilePath = remoteFilePath.substring(1);
|