feat():测试
parent
769faff8eb
commit
4190277076
|
@ -62,7 +62,7 @@ public class FilesCompilerLoad {
|
|||
|
||||
try {
|
||||
// class文件路径
|
||||
String externalClassFilePath = "/home/lib/com/muyu/generate/"+fileName+ MethodSuffix.CLASSSUFFIX;
|
||||
String externalClassFilePath = "/home/lib/com/muyu/generate/"+fileName;
|
||||
log.info(externalClassFilePath);
|
||||
Path path = Paths.get(externalClassFilePath);
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class FilesCompilerLoad {
|
|||
|
||||
// 加载类
|
||||
// 注意类名必须是完全限定名(包括包名)
|
||||
Class<?> clazz = externalClassLoader.loadClassFromPath(path, "/home/lib/com/muyu/generate/"+fileName+ MethodSuffix.CLASSSUFFIX);
|
||||
Class<?> clazz = externalClassLoader.loadClassFromPath(path, "/home/lib/com/muyu/generate/"+fileName);
|
||||
System.out.println(clazz);
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
|
|
@ -131,24 +131,9 @@ public class OSSFileLoad {
|
|||
ossClient.shutdown();
|
||||
}
|
||||
}
|
||||
//对路径里的.java文件进行编译
|
||||
//对路径里的.class文件进行编译
|
||||
System.out.println("执行编译");
|
||||
FilesCompilerLoad.classLoad(fileName);
|
||||
// SourceCodeCompiler.javaCompilerPath("home/");
|
||||
// System.out.println("第二步");
|
||||
// File outputDir = new File("home/"); // 或者是你指定的其他输出目录
|
||||
// System.out.println("第三步");
|
||||
// File[] classFiles = outputDir.listFiles(); // 获取输出目录中的所有文件
|
||||
// if (classFiles != null) {
|
||||
// for (File classFile : classFiles) {
|
||||
// if (classFile.getName().endsWith(".class")) {
|
||||
// System.out.println("找到class文件 " + classFile.getName());
|
||||
//// 把.class文件存入oss中
|
||||
// }
|
||||
// }
|
||||
// }else {
|
||||
// System.out.println("没有找到文件");
|
||||
// }
|
||||
return Result.success(source);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue