1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.geronimo.javamail.store.imap;
20
21 import javax.mail.Folder;
22 import javax.mail.Message;
23 import javax.mail.MessagingException;
24 import javax.mail.MethodNotSupportedException;
25 import javax.mail.Store;
26
27 import org.apache.geronimo.javamail.store.imap.connection.IMAPConnection;
28 import org.apache.geronimo.javamail.store.imap.connection.IMAPEnvelope;
29 import org.apache.geronimo.javamail.store.imap.connection.IMAPBodyStructure;
30
31
32
33
34
35 public class IMAPRootFolder extends IMAPFolder {
36
37
38
39
40
41
42 public IMAPRootFolder(IMAPStore store) {
43
44 super(store, "", '/');
45
46 folderType = HOLDS_FOLDERS;
47 }
48
49
50
51
52
53
54
55
56
57
58 public Folder getFolder(String name) throws MessagingException {
59
60
61
62
63 return new IMAPFolder((IMAPStore)store, name, UNDETERMINED);
64 }
65
66
67 public Folder getParent() {
68
69 return null;
70 }
71
72
73 public boolean exists() throws MessagingException {
74
75 return true;
76 }
77
78 public boolean hasNewMessages() {
79
80 return false;
81 }
82
83
84 public int getMessagesCount() {
85
86 return 0;
87 }
88
89
90 public int getNewMessagesCount() {
91
92 return 0;
93 }
94
95
96 public int getUnreadMessagesCount() {
97
98 return 0;
99 }
100
101
102 public int getDeletedMessagesCount() {
103
104 return 0;
105 }
106
107
108 public boolean create(int newType) throws MessagingException {
109 throw new MethodNotSupportedException("Default IMAP folder cannot be created");
110 }
111
112 public boolean delete(boolean recurse) throws MessagingException {
113 throw new MethodNotSupportedException("Default IMAP folder cannot be deleted");
114 }
115
116
117 public boolean rename(boolean recurse) throws MessagingException {
118 throw new MethodNotSupportedException("Default IMAP folder cannot be renamed");
119 }
120
121
122 public void appendMessages(Message[] msgs) throws MessagingException {
123 throw new MethodNotSupportedException("Messages cannot be appended to Default IMAP folder");
124 }
125
126
127 public Message[] expunge() throws MessagingException {
128 throw new MethodNotSupportedException("Messages cannot be expunged from Default IMAP folder");
129 }
130 }
131