package com.iailab.module.data.video.dahua; import com.iailab.netsdk.lib.ToolKits; import java.io.File; import java.io.IOException; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年03月06日 */ public class DHSavePath { private DHSavePath() {} private static DHSavePath instance = new DHSavePath(); public static DHSavePath getSavePath() { return instance; } /** * 设置抓图保存路径 * * @return */ public String getSaveCapturePath(String channel, Date curDate) { File path1 = new File(DHConfiguration.staticCapturePath); if (!path1.exists()) { path1.mkdir(); } File path2 = new File(DHConfiguration.staticCapturePath + ToolKits.getDay() + "/" + channel + "/"); if (!path2.exists()) { path2.mkdirs(); } String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate(curDate) + ".jpg"; return strFileName; } /** * 设置模型输出图片保存路径 * * @param cameraCode * @param curDate * @return */ public String getSaveModelPath(String cameraCode, Date curDate) throws IOException { // File path1 = new File(modelPath); // if (!path1.exists()) { // path1.mkdir(); // } File path2 = new File(DHConfiguration.staticModelPath + ToolKits.getDay() + "/" + cameraCode + "/"); // if (!path2.exists()) { // path2.mkdirs(); // } //return path2.getAbsolutePath() + "/"; return path2.getAbsolutePath(); } }