/* (non-Javadoc) * @see com.aptana.ide.core.io.vfs.IConnectionFileManager#disconnect(org.eclipse.core.runtime.IProgressMonitor) */ public synchronized void disconnect(IProgressMonitor monitor) throws CoreException { try { checkConnected(); } catch (Exception ignore) { } if (!isConnected()) { return; } monitor = Policy.monitorFor(monitor); monitor.beginTask( Messages.FTPConnectionFileManager_closing_connection, IProgressMonitor.UNKNOWN); try { ftpClient.quit(); } catch (Exception e) { try { ftpClient.quitImmediately(); } catch (Exception ignore) { } throw new CoreException( new Status( Status.ERROR, FTPPlugin.PLUGIN_ID, Messages.FTPConnectionFileManager_disconnect_failed, e)); } finally { cwd = null; pool.dispose(); cleanup(); monitor.done(); } }
protected void safeQuit() { try { if (ftpClient.connected()) { ftpClient.quit(); } } catch (Exception e) { try { ftpClient.quitImmediately(); } catch (Exception ignore) { } } }
/* (non-Javadoc) * @see com.aptana.ide.core.ftp.BaseFTPConnectionFileManager#checkConnected() */ @Override protected void checkConnected() throws Exception { if (ftpClient.connected()) { try { ftpClient.noOperation(); return; } catch (FTPConnectionClosedException e) { } catch (FTPException ignore) { return; } catch (IOException e) { } ftpClient.quitImmediately(); } }