提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.module.data.video.dahua; |
H |
2 |
|
08b6a5
|
3 |
import com.iailab.module.data.video.config.VideoConfiguration; |
149dd0
|
4 |
import com.iailab.netsdk.lib.ToolKits; |
H |
5 |
|
|
6 |
import java.io.File; |
|
7 |
import java.util.Date; |
|
8 |
|
|
9 |
/** |
|
10 |
* @author PanZhibao |
|
11 |
* @Description |
|
12 |
* @createTime 2024年03月06日 |
|
13 |
*/ |
|
14 |
public class DHSavePath { |
|
15 |
|
|
16 |
private DHSavePath() {} |
|
17 |
|
|
18 |
private static DHSavePath instance = new DHSavePath(); |
|
19 |
|
|
20 |
public static DHSavePath getSavePath() { |
|
21 |
return instance; |
|
22 |
} |
|
23 |
|
|
24 |
/** |
|
25 |
* 设置抓图保存路径 |
|
26 |
* |
|
27 |
* @return |
|
28 |
*/ |
|
29 |
public String getSaveCapturePath(String channel, Date curDate) { |
08b6a5
|
30 |
File path1 = new File(VideoConfiguration.staticDhCapturePath); |
149dd0
|
31 |
if (!path1.exists()) { |
H |
32 |
path1.mkdir(); |
|
33 |
} |
|
34 |
|
08b6a5
|
35 |
File path2 = new File(VideoConfiguration.staticDhCapturePath + ToolKits.getDay() + "/" + channel + "/"); |
149dd0
|
36 |
if (!path2.exists()) { |
H |
37 |
path2.mkdirs(); |
|
38 |
} |
|
39 |
|
|
40 |
String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate(curDate) + ".jpg"; |
|
41 |
|
|
42 |
return strFileName; |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* 设置模型输出图片保存路径 |
|
47 |
* |
|
48 |
* @param cameraCode |
|
49 |
* @param curDate |
|
50 |
* @return |
|
51 |
*/ |
08b6a5
|
52 |
// public String getSaveModelPath(String cameraCode, Date curDate) throws IOException { |
H |
53 |
//// File path1 = new File(modelPath); |
|
54 |
//// if (!path1.exists()) { |
|
55 |
//// path1.mkdir(); |
|
56 |
//// } |
|
57 |
// |
|
58 |
// File path2 = new File(DHConfiguration.staticModelPath + ToolKits.getDay() + "/" + cameraCode + "/"); |
|
59 |
//// if (!path2.exists()) { |
|
60 |
//// path2.mkdirs(); |
|
61 |
//// } |
|
62 |
// //return path2.getAbsolutePath() + "/"; |
|
63 |
// return path2.getAbsolutePath(); |
|
64 |
// } |
149dd0
|
65 |
} |