|
@@ -5,17 +5,16 @@ import com.fdkankan.fyun.constant.FYunConstants;
|
|
|
import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
|
import com.fdkankan.fyun.face.AbstractFYunFileService;
|
|
|
import com.fdkankan.fyun.local.constant.LocalConstants;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.util.ObjectUtils;
|
|
|
-
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
@Component
|
|
|
@ConditionalOnProperty(name = "fyun.type", havingValue = "local")
|
|
@@ -48,7 +47,7 @@ public class LocalFileService extends AbstractFYunFileService {
|
|
|
public String uploadFileByCommand(String bucket, String filePath, String remoteFilePath) {
|
|
|
try {
|
|
|
String optType = new File(filePath).isDirectory() ? "folder" : "file";
|
|
|
- String command = String.format(FYunConstants.UPLOAD_SH, bucket, filePath, remoteFilePath, FYunTypeEnum.LOCAL.code(), optType);
|
|
|
+ String command = String.format(fYunConstants.UPLOAD_SH, bucket, filePath, remoteFilePath, FYunTypeEnum.LOCAL.code(), optType);
|
|
|
log.info("开始上传文件, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
|
callshell(command);
|
|
|
} catch (Exception e) {
|
|
@@ -62,7 +61,7 @@ public class LocalFileService extends AbstractFYunFileService {
|
|
|
public void downloadFileByCommand(String bucket, String filePath, String remoteFilePath) {
|
|
|
try {
|
|
|
String optType = new File(filePath).isDirectory() ? "folder" : "file";
|
|
|
- String command = String.format(FYunConstants.DOWNLOAD_SH, bucket, filePath, remoteFilePath, FYunTypeEnum.LOCAL.code(), optType);
|
|
|
+ String command = String.format(fYunConstants.DOWNLOAD_SH, bucket, filePath, remoteFilePath, FYunTypeEnum.LOCAL.code(), optType);
|
|
|
log.info("开始上传文件, ossPath:{}, srcPath:{}", remoteFilePath, filePath);
|
|
|
callshell(command);
|
|
|
} catch (Exception e) {
|