From 5cd80ce4df5599c2b7e239655969bb20f5c42a73 Mon Sep 17 00:00:00 2001 From: jiangzeyin Date: Mon, 8 Apr 2019 18:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/NginxController.java | 2 +- .../cn/keepbx/jpom/model/JpomManifest.java | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/cn/keepbx/jpom/controller/system/NginxController.java b/src/main/java/cn/keepbx/jpom/controller/system/NginxController.java index a953ceeb9..fc75c94d8 100644 --- a/src/main/java/cn/keepbx/jpom/controller/system/NginxController.java +++ b/src/main/java/cn/keepbx/jpom/controller/system/NginxController.java @@ -106,7 +106,7 @@ public class NginxController extends BaseController { return JsonMessage.getString(400, "文件名存在非法字符"); } if (!whitelistDirectoryService.checkNgxDirectory(whitePath)) { - throw new RuntimeException("请选择正确的项目路径,或者还没有配置白名单"); + return JsonMessage.getString(400, "请选择正确的白名单"); } boolean add = "add".equals(genre); if ("quick".equals(type)) { diff --git a/src/main/java/cn/keepbx/jpom/model/JpomManifest.java b/src/main/java/cn/keepbx/jpom/model/JpomManifest.java index 60c62d8a6..64316cdec 100644 --- a/src/main/java/cn/keepbx/jpom/model/JpomManifest.java +++ b/src/main/java/cn/keepbx/jpom/model/JpomManifest.java @@ -34,16 +34,14 @@ public class JpomManifest { } if (manifestResources != null) { while (manifestResources.hasMoreElements()) { - try { - try (InputStream inputStream = manifestResources.nextElement().openStream()) { - Manifest manifest = new Manifest(inputStream); - Attributes attributes = manifest.getMainAttributes(); - String version = attributes.getValue("Jpom-Project-Version"); - if (version != null) { - JPOM_MANIFEST.setVersion(version); - String timeStamp = attributes.getValue("Jpom-Timestamp"); - JPOM_MANIFEST.setTimeStamp(timeStamp); - } + try (InputStream inputStream = manifestResources.nextElement().openStream()) { + Manifest manifest = new Manifest(inputStream); + Attributes attributes = manifest.getMainAttributes(); + String version = attributes.getValue("Jpom-Project-Version"); + if (version != null) { + JPOM_MANIFEST.setVersion(version); + String timeStamp = attributes.getValue("Jpom-Timestamp"); + JPOM_MANIFEST.setTimeStamp(timeStamp); } } catch (Exception ignored) { }