lyhzzz 2 лет назад
Родитель
Сommit
9194433666

+ 4 - 0
4dkankan-utils-model/src/main/java/com/fdkankan/model/constants/ConstantCmd.java

@@ -54,4 +54,8 @@ public class ConstantCmd {
 	// 修改户型图json文件
 	public static final String TRANSLATE_HOUST_FLOOR = "/opt/Robin/JsonRead.out ";
 
+
+	// 上传文件夹
+	public static final String OSS_UTIL_CP_FOLDER ="bash /opt/ossutil/upload.sh %s %s";
+
 }

+ 11 - 0
4dkankan-utils-model/src/main/java/com/fdkankan/model/utils/CreateObjUtil.java

@@ -622,4 +622,15 @@ public class CreateObjUtil {
 		log.info("matterpro获取阿里云图片方法完成,时间为:" + (System.currentTimeMillis() - start));
 	}
 
+	public static void ossUtilCpFolder(String sourceFolder , String targetFolder){
+		File sourceFile = new File(sourceFolder);
+		if (!sourceFile.exists()) {
+			log.error("oss文件夹上传异常,文件夹不存在{}", sourceFolder);
+		}
+		String command = String.format(ConstantCmd.OSS_UTIL_CP_FOLDER,targetFolder,sourceFolder);
+		Long start = System.currentTimeMillis();
+		log.info("开始上传oss文件夹:" + command);
+		callshell(command);
+		log.info("oss文件夹上传完成,时间为:" + (System.currentTimeMillis() - start));
+	}
 }