11111
parent
500119608d
commit
4a3af2cb6f
|
@ -27,7 +27,7 @@ import java.io.IOException;
|
|||
* 实现项目启动时,把文件下载到服务器里
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
//@Component
|
||||
public class DownloadOss implements ApplicationRunner {
|
||||
|
||||
private static final String endPoint = "oss-cn-beijing.aliyuncs.com";
|
||||
|
|
|
@ -110,11 +110,22 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl<RuleEngineVersionM
|
|||
public void HotLoadClass(String className, String versionClazz) {
|
||||
try {
|
||||
String ossFilePath = className + Suffix_JAVA;
|
||||
|
||||
String ossFilePath2 = className + Suffix_CLASS;
|
||||
EngineConfig engineConfig = new EngineConfig();
|
||||
|
||||
// String filePath ="home/"+ossFilePath;
|
||||
String filePath = engineConfig.getSourcePath() + ossFilePath;
|
||||
//创建服务器项目容器的文件目录路径
|
||||
File serverFile = new File(engineWorkSourcePath, ossFilePath);
|
||||
//如果目录不存在,则创建目录
|
||||
if (!serverFile.getParentFile().exists()){
|
||||
serverFile.getParentFile().mkdirs();
|
||||
}
|
||||
File classFile = new File(engineWorkClassPath, ossFilePath2);
|
||||
//如果目录不存在,则创建目录
|
||||
if (!classFile.getParentFile().exists()){
|
||||
classFile.getParentFile().mkdirs();
|
||||
}
|
||||
//下载文件到指定服务器目录下
|
||||
OssUtil.downloadFileForBucket(bucketName, ossFilePath, filePath);
|
||||
//编译
|
||||
|
|
Loading…
Reference in New Issue