Jelajahi Sumber

修改文件存储路径

xujiawei 4 tahun lalu
induk
melakukan
6a724d6fc2
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/main/java/edu/nju/service/DataService.java

+ 2 - 2
src/main/java/edu/nju/service/DataService.java

@@ -240,7 +240,7 @@ public class DataService {
 
     private void exportJson(List<BugDetail> bugDetailList, String caseId) {
         try {
-            File file = new File("xinchuangdata/output/" + caseId + "/" + caseId + ".json");
+            File file = new File("/xinchuangdata/output/" + caseId + "/" + caseId + ".json");
             if(!file.getParentFile().exists()) { file.getParentFile().mkdirs(); }
             JSONArray jsonArray = new JSONArray(bugDetailList);
             Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
@@ -255,7 +255,7 @@ public class DataService {
 
     private <T> void exportCsv(String[] titles, List<T> list, String caseId) {
         try {
-            File file = new File("xinchuangdata/output/" + caseId + "/" + caseId + ".csv");
+            File file = new File("/xinchuangdata/output/" + caseId + "/" + caseId + ".csv");
             if(!file.getParentFile().exists()) {file.getParentFile().mkdirs(); }
             //构建输出流,同时指定编码
             OutputStreamWriter ow = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);