MCPcopy Create free account
hub / github.com/M66B/FairEmail / open

Method open

app/src/main/java/com/sun/mail/pop3/POP3Folder.java:189–228  ·  view source on GitHub ↗

Throws FolderNotFoundException unless this folder is named "INBOX". @exception FolderNotFoundException if not INBOX @exception AuthenticationFailedException authentication failures @exception MessagingException other open failures

(int mode)

Source from the content-addressed store, hash-verified

187 * @exception MessagingException other open failures
188 */
189 @Override
190 public synchronized void open(int mode) throws MessagingException {
191 checkClosed();
192 if (!exists)
193 throw new FolderNotFoundException(this, "folder is not INBOX");
194
195 try {
196 port = store.getPort(this);
197 Status s = port.stat();
198 total = s.total;
199 size = s.size;
200 this.mode = mode;
201 if (store.useFileCache) {
202 try {
203 fileCache = new TempFile(store.fileCacheDir);
204 } catch (IOException ex) {
205 logger.log(Level.FINE, "failed to create file cache", ex);
206 throw ex; // caught below
207 }
208 }
209 opened = true;
210 } catch (IOException ioex) {
211 try {
212 if (port != null)
213 port.quit();
214 } catch (IOException ioex2) {
215 // ignore
216 } finally {
217 port = null;
218 store.closePort(this);
219 }
220 throw new MessagingException("Open failed", ioex);
221 }
222
223 // Create the message cache array of appropriate size
224 message_cache = new POP3Message[total];
225 doneUidl = false;
226
227 notifyConnectionListeners(ConnectionEvent.OPENED);
228 }
229
230 @Override
231 public synchronized void close(boolean expunge) throws MessagingException {

Callers

nothing calls this directly

Calls 7

checkClosedMethod · 0.95
statMethod · 0.80
closePortMethod · 0.80
getPortMethod · 0.45
logMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected