@Override public synchronized void close() throws MessagingException { close(false); }
@Override public Folder getDefaultFolder() throws MessagingException { checkConnected(); return new DefaultFolder(this); }
port = store.getPort(this); Status s = port.stat(); total = s.total; fileCache = new TempFile(store.fileCacheDir); } catch (IOException ex) { if (store.getSession().getDebug()) store.getSession().getDebugOut().println( "DEBUG POP3: failed to create file cache: " + ex); throw ex; // caught below store.closePort(this);
try { if (port == null) port = getPort(null); else if (!port.noop()) throw new IOException("NOOP failed");
store.closePort(this); message_cache = null; opened = false;
protected POP3Folder(POP3Store store, String name) { super(store); this.name = name; this.store = store; if (name.equalsIgnoreCase("INBOX")) exists = true; logger = new MailLogger(this.getClass(), "DEBUG POP3", store.getSession()); }
this.isSSL = isSSL; rsetBeforeQuit = getBoolProp("rsetbeforequit"); disableTop = getBoolProp("disabletop"); forgetTopHeaders = getBoolProp("forgettopheaders"); cacheWriteTo = getBoolProp("cachewriteto"); useFileCache = getBoolProp("filecache.enable"); String dir = session.getProperty("mail." + name + ".filecache.dir"); if (dir != null && logger.isLoggable(Level.CONFIG)) if (dir != null) fileCacheDir = new File(dir); keepMessageContent = getBoolProp("keepmessagecontent"); useStartTLS = getBoolProp("starttls.enable"); requireStartTLS = getBoolProp("starttls.required"); finalizeCleanClose = getBoolProp("finalizecleanclose");
private static IOException cleanupAndThrow(Protocol p, IOException ife) { try { p.quit(); } catch (Throwable thr) { if (isRecoverable(thr)) { ife.addSuppressed(thr); } else { thr.addSuppressed(ife); if (thr instanceof Error) { throw (Error) thr; } if (thr instanceof RuntimeException) { throw (RuntimeException) thr; } throw new RuntimeException("unexpected exception", thr); } } return ife; }
} else if (requireStartTLS) { logger.fine("STLS required but failed"); throw cleanupAndThrow(p, new EOFException("STLS required but failed")); throw cleanupAndThrow(p, new EOFException("STLS required but not supported")); throw cleanupAndThrow(p, new EOFException(msg));
try { if (port == null) port = getPort(null); else if (!port.noop()) throw new IOException("NOOP failed");
store.closePort(this); message_cache = null; opened = false;
protected POP3Folder(POP3Store store, String name) { super(store); this.name = name; this.store = store; if (name.equalsIgnoreCase("INBOX")) exists = true; logger = new MailLogger(this.getClass(), "DEBUG POP3", store.getSession().getDebug(), store.getSession().getDebugOut()); }
this.isSSL = isSSL; rsetBeforeQuit = getBoolProp("rsetbeforequit"); disableTop = getBoolProp("disabletop"); forgetTopHeaders = getBoolProp("forgettopheaders"); cacheWriteTo = getBoolProp("cachewriteto"); useFileCache = getBoolProp("filecache.enable"); String dir = session.getProperty("mail." + name + ".filecache.dir"); if (dir != null && logger.isLoggable(Level.CONFIG)) if (dir != null) fileCacheDir = new File(dir); keepMessageContent = getBoolProp("keepmessagecontent"); useStartTLS = getBoolProp("starttls.enable"); requireStartTLS = getBoolProp("starttls.required"); finalizeCleanClose = getBoolProp("finalizecleanclose");
private static IOException cleanupAndThrow(Protocol p, IOException ife) { try { p.quit(); } catch (Throwable thr) { if (isRecoverable(thr)) { ife.addSuppressed(thr); } else { thr.addSuppressed(ife); if (thr instanceof Error) { throw (Error) thr; } if (thr instanceof RuntimeException) { throw (RuntimeException) thr; } throw new RuntimeException("unexpected exception", thr); } } return ife; }
} else if (requireStartTLS) { logger.fine("STLS required but failed"); throw cleanupAndThrow(p, new EOFException("STLS required but failed")); throw cleanupAndThrow(p, new EOFException("STLS required but not supported")); throw cleanupAndThrow(p, new EOFException(msg));
public synchronized void close() throws MessagingException { close(false); }