SavePath.java
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.example.dahua.common;
import com.example.dahua.lib.ToolKits;
import java.io.File;
public class SavePath {
private SavePath() {}
private static class SavePathHolder {
private static SavePath instance = new SavePath();
}
public static SavePath getSavePath() {
return SavePathHolder.instance;
}
String s_captureSavePath = "./Capture/" + ToolKits.getDay() + "/"; // 抓拍图片保存路径
String s_imageSavePath = "./Image/" + ToolKits.getDay() + "/"; // 图片保存路径
String s_recordFileSavePath = "./RecordFile/" + ToolKits.getDay() + "/"; // 录像保存路径
/*
* 设置抓图保存路径
*/
public String getSaveCapturePath() {
File path1 = new File("./Capture/");
if (!path1.exists()) {
path1.mkdir();
}
File path2 = new File(s_captureSavePath);
if (!path2.exists()) {
path2.mkdir();
}
String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate() + ".jpg";
return strFileName;
}
/*
* 设置智能交通图片保存路径
*/
public String getSaveTrafficImagePath() {
File path1 = new File("./Image/");
if (!path1.exists()) {
path1.mkdir();
}
File path = new File(s_imageSavePath);
if (!path.exists()) {
path.mkdir();
}
return s_imageSavePath;
}
/*
* 设置录像保存路径
*/
public String getSaveRecordFilePath() {
File path1 = new File("./RecordFile/");
if (!path1.exists()) {
path1.mkdir();
}
File path2 = new File(s_recordFileSavePath);
if (!path2.exists()) {
path2.mkdir();
}
String SavedFileName = s_recordFileSavePath + ToolKits.getDate() + ".dav"; // 默认保存路径
return SavedFileName;
}
}