From 7d4123ba509ae1e3ab97373c0ce057ddb53697e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E8=BD=B2?= Date: Wed, 11 Oct 2023 02:07:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20AppConfig.java=20=E7=9A=84?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jcnc/jnotepad/app/config/AppConfig.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/main/java/org/jcnc/jnotepad/app/config/AppConfig.java b/src/main/java/org/jcnc/jnotepad/app/config/AppConfig.java index c2488af..ad46c98 100644 --- a/src/main/java/org/jcnc/jnotepad/app/config/AppConfig.java +++ b/src/main/java/org/jcnc/jnotepad/app/config/AppConfig.java @@ -14,7 +14,12 @@ import static org.jcnc.jnotepad.common.constants.AppConstants.PROGRAM_FILE_DIREC /** * 应用程序配置文件 * + *

+ * 此类用于存储应用程序的配置信息,包括程序根路径、排除的文件夹和文件等。 + *

+ * * @author gewuyou + * */ public class AppConfig { /** @@ -37,6 +42,9 @@ public class AppConfig { @JsonIgnore private String lastRootPath; + /** + * 构造应用程序配置对象 + */ public AppConfig() { ignoreFolder = Set.of( new File(Paths.get(System.getProperty(DEFAULT_PROPERTY), PROGRAM_FILE_DIRECTORY, "system").toString()), @@ -45,26 +53,56 @@ public class AppConfig { ignoreFile = Collections.emptySet(); } + /** + * 获取程序根路径 + * + * @return 程序根路径 + */ public String getRootPath() { return Optional.ofNullable(rootPath).orElse(System.getProperty(DEFAULT_PROPERTY)); } + /** + * 设置程序根路径 + * + * @param rootPath 程序根路径 + */ public void setRootPath(String rootPath) { this.rootPath = rootPath; } + /** + * 获取上次的程序根路径 + * + * @return 上次的程序根路径 + */ public String getLastRootPath() { return lastRootPath; } + /** + * 设置上次的程序根路径 + * + * @param lastRootPath 上次的程序根路径 + */ public void setLastRootPath(String lastRootPath) { this.lastRootPath = lastRootPath; } + /** + * 获取排除的文件夹集合 + * + * @return 排除的文件夹集合 + */ public Set getIgnoreFolder() { return ignoreFolder; } + /** + * 获取排除的文件集合 + * + * @return 排除的文件集合 + */ public Set getIgnoreFile() { return ignoreFile; }