Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 24771b5

Browse files
committed
修改Windows配置文件路径
1 parent 6efee01 commit 24771b5

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
- 配置文件
3232

33-
Windows使用路径:`C:/Program Files/Qiniu Tool`
33+
Windows使用路径:`C:/ProgramData/QiniuTool`
3434

3535
MacOS 或 Linux 使用路径:`/tmp/qiniu/tool`
3636

@@ -108,7 +108,7 @@
108108

109109
**3. 其他**
110110

111-
- [**下载可执行的jar包**](http://oq3iwfipo.bkt.clouddn.com/tools/zhazhapan/qiniu.jar "七牛云——对象存储管理工具jar包下载地址")
111+
- [**下载可执行的jar包**](http://oq3iwfipo.bkt.clouddn.com/tools/zhazhapan/qiniu.jar?v=1.0.2 "七牛云——对象存储管理工具jar包下载地址")
112112

113113
- [**历史版本**](https://github.com/zhazhapan/qiniu/releases)
114114

src/main/java/com/zhazhapan/qiniu/QiniuApplication.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public static void main(String[] args) {
8989
} else {
9090
workDir = Values.APP_PATH_OF_UNIX;
9191
}
92-
ConfigLoader.configPath = workDir + Values.CONFIG_PATH;
92+
ConfigLoader.configPath = workDir + Values.SEPARATOR + Values.CONFIG_PATH;
93+
logger.info("current work director: " + workDir + ", config file: " + ConfigLoader.configPath);
9394
mainWindow = new MainWindow();
9495
launch(args);
9596
}

src/main/java/com/zhazhapan/qiniu/modules/constant/Values.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*/
44
package com.zhazhapan.qiniu.modules.constant;
55

6+
import java.io.File;
7+
68
/**
79
* @author pantao
810
*
@@ -15,11 +17,13 @@ public class Values {
1517

1618
public static final String INIT_APP_ERROR_HEADER = "初始化错误,无法继续运行";
1719

18-
public static final String APP_PATH_OF_WINDOWS = "C:/Program Files/Qiniu Tool";
20+
public static final String APP_PATH_OF_WINDOWS = "C:\\ProgramData\\QiniuTool";
1921

2022
public static final String APP_PATH_OF_UNIX = "/tmp/qiniu/tool";
2123

22-
public static final String CONFIG_PATH = "/config.json";
24+
public static final String SEPARATOR = File.separator;
25+
26+
public static final String CONFIG_PATH = "config.json";
2327

2428
public static final String FORMAT_JSON_ERROR = "将字符串格式化为JSON失败";
2529

src/main/java/com/zhazhapan/qiniu/view/Dialogs.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public boolean showInputKeyDialog() {
145145
Platform.runLater(() -> ak.requestFocus());
146146

147147
Optional<String[]> result = dialog.showAndWait();
148-
if (result.isPresent()) {
148+
if (result.isPresent() && Checker.isNotEmpty(ak.getText()) && Checker.isNotEmpty(sk.getText())) {
149149
ConfigLoader.writeKey(ak.getText(), sk.getText());
150150
return true;
151151
}

src/main/java/com/zhazhapan/qiniu/view/MainWindow.fxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
<children>
249249
<VBox prefHeight="520.0" prefWidth="593.0" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.rowSpan="2">
250250
<children>
251-
<Label text="当前版本: v1.0.1">
251+
<Label text="当前版本: v1.0.2">
252252
<font>
253253
<Font size="20.0" />
254254
</font>

src/main/java/com/zhazhapan/qiniu/view/MainWindow.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ public void init() {
6262
// 将上传日志写入磁盘
6363
String content = MainWindowController.getInstance().uploadStatusTextArea.getText();
6464
if (Checker.isNotEmpty(content)) {
65-
String logPath = QiniuApplication.workDir + "/upload_"
65+
String logPath = QiniuApplication.workDir + Values.SEPARATOR + "upload_"
6666
+ Formatter.dateToString(new Date()).replaceAll("-", "_") + ".log";
6767
new FileExecutor().saveFile(logPath, content, true);
6868
}
6969
// 将删除记录写入磁盘
7070
String deleteContent = QiniuApplication.deleteLog.toString();
7171
if (Checker.isNotEmpty(deleteContent)) {
72-
String logPath = QiniuApplication.workDir + "/delete_"
72+
String logPath = QiniuApplication.workDir + Values.SEPARATOR + "delete_"
7373
+ Formatter.dateToString(new Date()).replaceAll("-", "_") + ".log";
7474
new FileExecutor().saveFile(logPath, deleteContent, true);
7575
}

0 commit comments

Comments
 (0)