From 734babb3a7348050fdffe845c560ba8b0b218152 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 20 十一月 2023 18:24:43 +0800
Subject: [PATCH] 2023年11月20日18:24:36
---
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java | 38 +++++++++++++++++++++++++++++---------
1 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
index b0b7b8f..69b3e95 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
@@ -25,7 +25,7 @@
private static volatile HdlFileLogic sHdlFileLogic;
/**
- * 琛ㄧず1m鏁版嵁
+ * 琛ㄧず1m澶у皬鏁版嵁
*/
private final int m = 1;
@@ -61,35 +61,50 @@
* 鑾峰彇鎵嬫満鍐呴儴瀛樺偍鏂囦欢璺緞
*/
public String getAPPInternalStoreFilesPath() {
- return HDLApp.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getPath();
+ return Objects.requireNonNull(HDLApp.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS)).getPath();
}
/**
- * 鑾峰彇瀛樻斁銆愮敤鎴枫�戞枃浠跺す鏍硅矾寰�
+ * 鑾峰彇瀛樻斁銆愮敤鎴锋枃浠跺す銆戞牴璺緞
*/
public String getCurrentUserRootPath() {
return getAPPInternalStoreFilesPath() + "/" + getUserId();
}
/**
- * 鑾峰彇瀛樻斁銆愪綇瀹呫�戞枃浠跺す鏍硅矾寰�
+ * 鑾峰彇瀛樻斁銆愪綇瀹呮枃浠跺す銆戞牴璺緞
*/
public String getCurrentHomeRootPath() {
return getCurrentUserRootPath() + "/" + "home_" + getHomeId();
}
/**
- * 鑾峰彇銆愭棩蹇椼�戞枃浠跺叏璺緞
+ * 鑾峰彇瀛樻斁銆愰┍鍔ㄦ枃浠跺す銆戞牴璺緞
*/
- public String getLogFilePath() {
- return getCurrentHomeRootPath() + "/Log.txt";
+ public String getDriveRootPath() {
+ return getAPPInternalStoreFilesPath() + "/upgrade/drive";
+ }
+
+
+ /**
+ * 鑾峰彇瀛樻斁銆愬浐浠舵枃浠跺す銆戞牴璺緞
+ */
+ public String getFirmwareRootPath() {
+ return getAPPInternalStoreFilesPath() + "/upgrade/firmware";
}
/**
- * 鑾峰彇銆愮敤鎴枫�戞枃浠跺叏璺緞
+ * 鑾峰彇銆愭棩蹇楁枃浠躲�戝叏璺緞
+ */
+ public String getLogFilePath() {
+ return getCurrentHomeRootPath() + "/log.txt";
+ }
+
+ /**
+ * 鑾峰彇銆愮敤鎴锋枃浠躲�戝叏璺緞
*/
public String getUserFilePath() {
- return getAPPInternalStoreFilesPath() + "/UserConfigManage.txt";
+ return getAPPInternalStoreFilesPath() + "/userConfigManage.txt";
}
//endregion
@@ -102,6 +117,11 @@
public void createDirectory() {
//瀛樻斁浣忓畢淇℃伅
this.createFileDir(this.getCurrentHomeRootPath());
+ //椹卞姩鏂囦欢
+ this.createFileDir(this.getDriveRootPath());
+ //鍥轰欢鏂囦欢
+ this.createFileDir(this.getFirmwareRootPath());
+
}
/**
--
Gitblit v1.8.0