增加 AppConfig.java 的注释
This commit is contained in:
parent
464532b509
commit
7d4123ba50
@ -14,7 +14,12 @@ import static org.jcnc.jnotepad.common.constants.AppConstants.PROGRAM_FILE_DIREC
|
||||
/**
|
||||
* 应用程序配置文件
|
||||
*
|
||||
* <p>
|
||||
* 此类用于存储应用程序的配置信息,包括程序根路径、排除的文件夹和文件等。
|
||||
* </p>
|
||||
*
|
||||
* @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<File> getIgnoreFolder() {
|
||||
return ignoreFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排除的文件集合
|
||||
*
|
||||
* @return 排除的文件集合
|
||||
*/
|
||||
public Set<File> getIgnoreFile() {
|
||||
return ignoreFile;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user