mac
2023-11-20 734babb3a7348050fdffe845c560ba8b0b218152
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());
    }
    /**