mac
2023-11-21 9f9e16bc9b4caecf741339a0699d784558fbc738
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,62 @@
     * 获取手机内部存储文件路径
     */
    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";
    }
    /**
     * 获取驱动升级文件全路径
     *
     * @param driverCode 驱动编码
     * @param version    驱动版本
     * @return 全路径
     */
    public String getDrivePathFileName(String driverCode, String version) {
        String driverFileName = driverCode + "_" + version  + ".zip";
        return HdlFileLogic.getInstance().getDriveRootPath() + "/" + driverFileName;
    }
    //endregion
@@ -102,6 +129,11 @@
    public void createDirectory() {
        //存放住宅信息
        this.createFileDir(this.getCurrentHomeRootPath());
        //驱动文件
        this.createFileDir(this.getDriveRootPath());
        //固件文件
        this.createFileDir(this.getFirmwareRootPath());
    }
    /**