修改bug

master
whb 8 months ago
parent be96e3693d
commit 68a33ce943

@ -82,12 +82,12 @@ public class JupyterhubController {
String newCreatFile = path + caseName;
File dataFile = new File(newCreatFile);
//判断文件夹是否存在
if (!dataFile.exists()) {
//创建文件夹
dataFile.mkdir();
// File dataFile = new File(newCreatFile);
//
// //判断文件夹是否存在
//
// //创建文件夹
// dataFile.mkdir();
//判断有无ipynb文件进行迁移
@ -134,10 +134,20 @@ public class JupyterhubController {
if (exitCode == 0) {
// 执行成功输出Python代码的结果
System.out.println("文件迁移成功!");
//判断子目录是否有data文件
String sonPath = newCreatFile + "/data";
File sonFile = new File(sonPath);
if (sonFile.exists()) {
return new ResultEntity<>(HttpStatus.OK, "数据存在!", true);
} else {
return new ResultEntity<>(HttpStatus.OK, "数据不存在!", false);
}
} else {
// 执行失败,输出错误信息
System.err.println("文件迁移失败了!\n" + errors.toString());
return new ResultEntity<>(HttpStatus.OK, "数据不存在!", false);
}
} catch (IOException | InterruptedException e) {
@ -149,19 +159,11 @@ public class JupyterhubController {
}
return new ResultEntity<>(HttpStatus.OK, "数据不存在!", false);
} else {
//判断子目录是否有data文件
String sonPath = newCreatFile + "/data";
File sonFile = new File(sonPath);
if (sonFile.exists()) {
return new ResultEntity<>(HttpStatus.OK, "数据存在!", true);
} else {
return new ResultEntity<>(HttpStatus.OK, "数据不存在!", false);
}
}
}

Loading…
Cancel
Save