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