package com.iailab.module.data.dev.dahua; import com.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 final static String capturePath = "Z:/irs/Capture/"; public final static String modelPath = "Z:/irs/Model/"; public final static String capturePathUbuntu = "/home/dell/DLUT/irs/Capture/"; public final static String modelPathUbuntu = "/home/dell/DLUT/irs/Model/"; public static DHSavePath getSavePath() { return instance; } /** * 设置抓图保存路径 * * @return */ public String getSaveCapturePath(String channel, Date curDate) { File path1 = new File(capturePath); if (!path1.exists()) { path1.mkdir(); } File path2 = new File(capturePath + 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(modelPath + ToolKits.getDay() + "/" + cameraCode + "/"); // if (!path2.exists()) { // path2.mkdirs(); // } //return path2.getAbsolutePath() + "/"; return path2.getAbsolutePath(); } }