From 520ea8cff4e8da5ad07f7bbed818fc0f1ef1e964 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Wed, 26 Feb 2020 17:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96json?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B9=B1=E7=A0=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/META-INF/MANIFEST.MF | 3 +++ src/com/qy/ui/ChuanShanJiaUi.java | 2 +- src/com/qy/utils/Tools.java | 16 +++++----------- 3 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 src/META-INF/MANIFEST.MF diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..807b30e --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: com.qy.ui.AppMain + diff --git a/src/com/qy/ui/ChuanShanJiaUi.java b/src/com/qy/ui/ChuanShanJiaUi.java index 891c832..ee8277f 100644 --- a/src/com/qy/ui/ChuanShanJiaUi.java +++ b/src/com/qy/ui/ChuanShanJiaUi.java @@ -64,7 +64,7 @@ public class ChuanShanJiaUi { } }else{ append("没有找到穿山甲demo,请将穿山甲demo放置在 input"+File.separator+"csjDemo文件夹中"); - csjDemo.mkdirs(); + csjPath.mkdirs(); } } } diff --git a/src/com/qy/utils/Tools.java b/src/com/qy/utils/Tools.java index cac2b49..7c47496 100755 --- a/src/com/qy/utils/Tools.java +++ b/src/com/qy/utils/Tools.java @@ -1,14 +1,7 @@ package com.qy.utils; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.Random; import org.json.JSONObject; @@ -130,9 +123,9 @@ public class Tools { e.printStackTrace(); } } else { + String tmp, str = ""; try { - reader = new BufferedReader(new FileReader(file)); - String tmp, str = ""; + reader = new BufferedReader( new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)); while ((tmp = reader.readLine()) != null) { str += tmp; } @@ -140,6 +133,7 @@ public class Tools { } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); + System.out.println(str); } } return json;