Changes
parent
a056d109f2
commit
8bbcc0882d
|
@ -65,6 +65,8 @@ public class RuleEditionController {
|
||||||
//java OSS
|
//java OSS
|
||||||
UploadOss.uploadFiles(ruleEdition.getRuleEngine(), ruleEdition.getRuleKind());
|
UploadOss.uploadFiles(ruleEdition.getRuleEngine(), ruleEdition.getRuleKind());
|
||||||
|
|
||||||
|
|
||||||
|
OSSFileDownload.streamingDownload(ruleEdition.getRuleKind());
|
||||||
OSSFileDownload.compile(ruleEdition.getRuleKind());
|
OSSFileDownload.compile(ruleEdition.getRuleKind());
|
||||||
|
|
||||||
// //对路径里的.java文件进行编译
|
// //对路径里的.java文件进行编译
|
||||||
|
|
|
@ -23,30 +23,30 @@ public class OSSFileDownload {
|
||||||
private static final String filePath = "oss/";
|
private static final String filePath = "oss/";
|
||||||
|
|
||||||
|
|
||||||
// public static Result<Object> streamingDownload(String fileName) {
|
public static Result<Object> streamingDownload(String fileName) {
|
||||||
//
|
|
||||||
// String source = null;
|
String source = null;
|
||||||
// // 创建 OSSClient 实例
|
// 创建 OSSClient 实例
|
||||||
// OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
|
OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
|
||||||
// // 判断 bucket 是否存在
|
// 判断 bucket 是否存在
|
||||||
// Boolean flag_bucket = ossClient.doesBucketExist(bucketName);
|
Boolean flag_bucket = ossClient.doesBucketExist(bucketName);
|
||||||
// if (!flag_bucket) {
|
if (!flag_bucket) {
|
||||||
// System.out.println("bucket不存在");
|
System.out.println("bucket不存在");
|
||||||
// return Result.error("bucket不存在");
|
return Result.error("bucket不存在");
|
||||||
// }
|
}
|
||||||
// String objectName = fileName + ".java";
|
String objectName = fileName + ".java";
|
||||||
// Boolean flag_file = ossClient.doesObjectExist(bucketName, filePath + objectName);
|
Boolean flag_file = ossClient.doesObjectExist(bucketName, filePath + objectName);
|
||||||
// if (!flag_file) {
|
if (!flag_file) {
|
||||||
// System.out.println("预下载文件不存在");
|
System.out.println("预下载文件不存在");
|
||||||
// return Result.error("预下载文件不存在");
|
return Result.error("预下载文件不存在");
|
||||||
// }
|
}
|
||||||
// // 本地文件下载路径
|
// 本地文件下载路径
|
||||||
// String localPath = "home/" + objectName;
|
String localPath = "home/" + objectName;
|
||||||
// ObjectMetadata object = ossClient.getObject(new GetObjectRequest(bucketName, filePath + objectName), new File(localPath));
|
ObjectMetadata object = ossClient.getObject(new GetObjectRequest(bucketName, filePath + objectName), new File(localPath));
|
||||||
// System.out.println(object);
|
System.out.println(object);
|
||||||
// ossClient.shutdown();
|
ossClient.shutdown();
|
||||||
// return Result.success(source);
|
return Result.success(source);
|
||||||
// }
|
}
|
||||||
|
|
||||||
public static Result<Object> compile(String fileName) {
|
public static Result<Object> compile(String fileName) {
|
||||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||||
|
|
Loading…
Reference in New Issue