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

Commit

Permalink
修改Windows配置文件路径
Browse files Browse the repository at this point in the history
  • Loading branch information
easepan committed Oct 17, 2017
1 parent 6efee01 commit 24771b5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- 配置文件

Windows使用路径:`C:/Program Files/Qiniu Tool`
Windows使用路径:`C:/ProgramData/QiniuTool`

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

Expand Down Expand Up @@ -108,7 +108,7 @@

**3. 其他**

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

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

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/zhazhapan/qiniu/QiniuApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public static void main(String[] args) {
} else {
workDir = Values.APP_PATH_OF_UNIX;
}
ConfigLoader.configPath = workDir + Values.CONFIG_PATH;
ConfigLoader.configPath = workDir + Values.SEPARATOR + Values.CONFIG_PATH;
logger.info("current work director: " + workDir + ", config file: " + ConfigLoader.configPath);
mainWindow = new MainWindow();
launch(args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
package com.zhazhapan.qiniu.modules.constant;

import java.io.File;

/**
* @author pantao
*
Expand All @@ -15,11 +17,13 @@ public class Values {

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

public static final String APP_PATH_OF_WINDOWS = "C:/Program Files/Qiniu Tool";
public static final String APP_PATH_OF_WINDOWS = "C:\\ProgramData\\QiniuTool";

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

public static final String CONFIG_PATH = "/config.json";
public static final String SEPARATOR = File.separator;

public static final String CONFIG_PATH = "config.json";

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

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zhazhapan/qiniu/view/Dialogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public boolean showInputKeyDialog() {
Platform.runLater(() -> ak.requestFocus());

Optional<String[]> result = dialog.showAndWait();
if (result.isPresent()) {
if (result.isPresent() && Checker.isNotEmpty(ak.getText()) && Checker.isNotEmpty(sk.getText())) {
ConfigLoader.writeKey(ak.getText(), sk.getText());
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zhazhapan/qiniu/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<children>
<VBox prefHeight="520.0" prefWidth="593.0" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.rowSpan="2">
<children>
<Label text="当前版本: v1.0.1">
<Label text="当前版本: v1.0.2">
<font>
<Font size="20.0" />
</font>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zhazhapan/qiniu/view/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public void init() {
// 将上传日志写入磁盘
String content = MainWindowController.getInstance().uploadStatusTextArea.getText();
if (Checker.isNotEmpty(content)) {
String logPath = QiniuApplication.workDir + "/upload_"
String logPath = QiniuApplication.workDir + Values.SEPARATOR + "upload_"
+ Formatter.dateToString(new Date()).replaceAll("-", "_") + ".log";
new FileExecutor().saveFile(logPath, content, true);
}
// 将删除记录写入磁盘
String deleteContent = QiniuApplication.deleteLog.toString();
if (Checker.isNotEmpty(deleteContent)) {
String logPath = QiniuApplication.workDir + "/delete_"
String logPath = QiniuApplication.workDir + Values.SEPARATOR + "delete_"
+ Formatter.dateToString(new Date()).replaceAll("-", "_") + ".log";
new FileExecutor().saveFile(logPath, deleteContent, true);
}
Expand Down

0 comments on commit 24771b5

Please sign in to comment.