This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
src/main/java/com/zhazhapan/qiniu Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3232
3333 Windows使用路径:` C:/ProgramData/QiniuTool `
3434
35- MacOS 或 Linux 使用路径:` /tmp/qiniu/tool `
35+ MacOS 或 Linux 使用路径:` $user.home/qntool `
3636
3737 其中 ` config.json ` 为配置文件
3838
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void downloadFromNet(String downloadURL) {
4040 }
4141 if (!checkDownloadPath ()) {
4242 QiniuApplication .downloadPath = Dialogs .showInputDialog (null , Values .CONFIG_DOWNLOAD_PATH ,
43- System . getProperty ( "user.home" ) );
43+ Values . USER_HOME );
4444 if (!checkDownloadPath ()) {
4545 return ;
4646 }
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public static void loadConfig() {
120120 }
121121 // 如果Key是Null则退出程序
122122 if (Checker .isNull (QiniuApplication .key )) {
123+ logger .info ("stop running" );
123124 System .exit (0 );
124125 }
125126 }
@@ -155,7 +156,7 @@ public static JsonObject readConfig() {
155156 logger .info ("load configuration into memory" );
156157 String content = new FileExecutor ().readFile (configPath );
157158 if (Checker .isNullOrEmpty (content )) {
158- Dialogs .showFatalError (Values .LOAD_CONFIG_ERROR , new IOException ("load configuration file error" ));
159+ Dialogs .showException (Values .LOAD_CONFIG_ERROR , new IOException ("load configuration file error" ));
159160 } else {
160161 jsonObject = new JsonParser ().parse (content ).getAsJsonObject ();
161162 }
Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ public class Values {
1313
1414 public static final String QINIU_KEY_URL = "https://portal.qiniu.com/user/key" ;
1515
16+ public static final String USER_HOME = System .getProperty ("user.home" );
17+
1618 public static final String MAIN_TITLE = "七牛云管理工具" ;
1719
1820 public static final String INIT_APP_ERROR_HEADER = "初始化错误,无法继续运行" ;
1921
2022 public static final String APP_PATH_OF_WINDOWS = "C:\\ ProgramData\\ QiniuTool" ;
2123
22- public static final String APP_PATH_OF_UNIX = "/tmp/qiniu/tool " ;
24+ public static final String APP_PATH_OF_UNIX = USER_HOME + "/qntool " ;
2325
2426 public static final String SEPARATOR = File .separator ;
2527
You can’t perform that action at this time.
0 commit comments