1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package davmail.exchange.ews;
20
21 import java.util.HashMap;
22 import java.util.Map;
23
24
25
26
27 public final class DistinguishedFolderId extends FolderId {
28
29 private DistinguishedFolderId(String value) {
30 super("t:DistinguishedFolderId", value, null);
31 }
32
33 private DistinguishedFolderId(String value, String mailbox) {
34 super("t:DistinguishedFolderId", value, null, mailbox);
35 }
36
37
38
39
40 @SuppressWarnings({"UnusedDeclaration"})
41 public enum Name {
42 calendar, contacts, deleteditems, drafts, inbox, journal, notes, outbox, sentitems, tasks, msgfolderroot,
43 publicfoldersroot, root, junkemail, searchfolders, voicemail,
44 archivemsgfolderroot
45 }
46
47 private static final Map<Name, DistinguishedFolderId> folderIdMap = new HashMap<>();
48
49 static {
50 for (Name name : Name.values()) {
51 folderIdMap.put(name, new DistinguishedFolderId(name.toString()));
52 }
53 }
54
55
56
57
58
59
60
61
62 public static DistinguishedFolderId getInstance(String mailbox, Name name) {
63 if (mailbox == null) {
64 return folderIdMap.get(name);
65 } else {
66 return new DistinguishedFolderId(name.toString(), mailbox);
67 }
68 }
69
70 }