| | |
| | | private static volatile HdlFileLogic sHdlFileLogic; |
| | | |
| | | /** |
| | | * 表示1m数据 |
| | | * 表示1m大小数据 |
| | | */ |
| | | private final int m = 1; |
| | | |
| | |
| | | * 获取手机内部存储文件路径 |
| | | */ |
| | | 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 |
| | |
| | | public void createDirectory() { |
| | | //存放住宅信息 |
| | | this.createFileDir(this.getCurrentHomeRootPath()); |
| | | //驱动文件 |
| | | this.createFileDir(this.getDriveRootPath()); |
| | | //固件文件 |
| | | this.createFileDir(this.getFirmwareRootPath()); |
| | | |
| | | } |
| | | |
| | | /** |