From be96e3693da5a68b5fdff4e9aac0772b73c756d1 Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Fri, 2 Aug 2024 18:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/stu/JupyterhubController.java | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/stu/JupyterhubController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/stu/JupyterhubController.java index 632ec77..eae4e9e 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/stu/JupyterhubController.java +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/stu/JupyterhubController.java @@ -89,50 +89,6 @@ public class JupyterhubController { //创建文件夹 dataFile.mkdir(); - //修改权限 - try { - // 创建 chmod 命令以递归方式修改权限 - String[] command = {"chmod", "-R", "777", newCreatFile}; - // 创建一个新的进程来执行Python代码 - Process process = Runtime.getRuntime().exec(command); - - - // 获取进程的输入流 - BufferedReader inputStream = new BufferedReader(new InputStreamReader(process.getInputStream())); - - // 获取进程的输出流 - BufferedReader errorStream = new BufferedReader(new InputStreamReader(process.getErrorStream())); - - - // 读取Python代码的输出 - String line; - StringBuilder output = new StringBuilder(); - while ((line = inputStream.readLine()) != null) { - output.append(line).append("\n"); - } - - // 读取Python代码的错误信息 - StringBuilder errors = new StringBuilder(); - while ((line = errorStream.readLine()) != null) { - errors.append(line).append("\n"); - } - - // 等待进程执行完成 - int exitCode = process.waitFor(); - - if (exitCode == 0) { - // 执行成功,输出Python代码的结果 - System.out.println("权限修改成功!"); - - } else { - // 执行失败,输出错误信息 - System.err.println("权限修改失败了!\n" + errors.toString()); - - } - } catch (IOException | InterruptedException e) { - e.printStackTrace(); - } - //判断有无ipynb文件,进行迁移 // 使用File类表示这个文件 @@ -198,7 +154,6 @@ public class JupyterhubController { } else { //判断子目录是否有data文件 - String sonPath = newCreatFile + "/data"; File sonFile = new File(sonPath); if (sonFile.exists()) {