private boolean checkAndHandleDone() { if (isDone()) { // for cancel the done event should have been fired always. if (!doneFired) { fireTransferReceiveDoneEvent(); } return true; } return false; }
private boolean checkAndHandleDone() { if (isDone()) { // for cancel the done event should have been fired always. if (!doneFired) { fireTransferReceiveDoneEvent(); } return true; } return false; }
protected boolean doPause() { if (isPaused() || !isConnected() || isDone()) return false; this.paused = true; return this.paused; }
protected boolean doPause() { if (isPaused() || !isConnected() || isDone()) return false; this.paused = true; return this.paused; }
private IStatus performConnect(IProgressMonitor monitor) { // there might be more ticks in the future perhaps for // connect socket, certificate validation, send request, authenticate, int ticks = 1; monitor.beginTask(getRemoteFileURL().toString() + Messages.HttpClientRetrieveFileTransfer_CONNECTING_TASK_NAME, ticks); try { if (monitor.isCanceled()) throw newUserCancelledException(); httpContext = new BasicHttpContext(); httpResponse = httpClient.execute(getMethod, httpContext); responseCode = httpResponse.getStatusLine().getStatusCode(); Trace.trace(Activator.PLUGIN_ID, "retrieve resp=" + responseCode); //$NON-NLS-1$ } catch (final Exception e) { Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "performConnect", e); //$NON-NLS-1$ if (!isDone()) { setDoneException(e); } } finally { monitor.done(); } return Status.OK_STATUS; }
private IStatus performConnect(IProgressMonitor monitor) { // there might be more ticks in the future perhaps for // connect socket, certificate validation, send request, authenticate, int ticks = 1; monitor.beginTask(getRemoteFileURL().toString() + Messages.HttpClientRetrieveFileTransfer_CONNECTING_TASK_NAME, ticks); try { if (monitor.isCanceled()) throw newUserCancelledException(); httpContext = new BasicHttpContext(); httpResponse = httpClient.execute(getMethod, httpContext); responseCode = httpResponse.getStatusLine().getStatusCode(); Trace.trace(Activator.PLUGIN_ID, "retrieve resp=" + responseCode); //$NON-NLS-1$ } catch (final Exception e) { Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "performConnect", e); //$NON-NLS-1$ if (!isDone()) { setDoneException(e); } } finally { monitor.done(); } return Status.OK_STATUS; }
protected void hardClose() { // changed for addressing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292 if (getMethod != null) { // First, if !isDone and paused if (!isDone() && isPaused()) getMethod.abort(); // release in any case //getMethod.releaseConnection(); // and set to null getMethod = null; } // Close output stream...if we're supposed to try { if (localFileContents != null && closeOutputStream) localFileContents.close(); } catch (final IOException e) { Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "hardClose", e)); //$NON-NLS-1$ } // clear input and output streams remoteFileContents = null; localFileContents = null; // reset response code responseCode = -1; // If we're done and proxy helper still exists, then dispose if (proxyHelper != null && isDone()) { proxyHelper.dispose(); proxyHelper = null; } }
protected void hardClose() { // changed for addressing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292 if (getMethod != null) { // First, if !isDone and paused if (!isDone() && isPaused()) getMethod.abort(); // release in any case //getMethod.releaseConnection(); // and set to null getMethod = null; } // Close output stream...if we're supposed to try { if (localFileContents != null && closeOutputStream) localFileContents.close(); } catch (final IOException e) { Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "hardClose", e)); //$NON-NLS-1$ } // clear input and output streams remoteFileContents = null; localFileContents = null; // reset response code responseCode = -1; // If we're done and proxy helper still exists, then dispose if (proxyHelper != null && isDone()) { proxyHelper.dispose(); proxyHelper = null; } }
Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "openStreamsForResume", e); //$NON-NLS-1$ if (code == -1) { if (!isDone()) { setDoneException(e);
Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "openStreamsForResume", e); //$NON-NLS-1$ if (code == -1) { if (!isDone()) { setDoneException(e);
Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, this.getClass(), "openStreams", e); //$NON-NLS-1$ if (code == -1) { if (!isDone()) { setDoneException(e);
Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, this.getClass(), "openStreams", e); //$NON-NLS-1$ if (code == -1) { if (!isDone()) { setDoneException(e);