public synchronized boolean resume() { this.isPause = false; if (this.pasuable != null) { return this.pasuable.resume(); } return false; }
/** * @return UserCancelledException if some user cancellation * @since 3.0 */ protected UserCancelledException newUserCancelledException() { return new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled); }
/** * @param name the name for this file transfer job. Should not be <code>null</code>. */ public FileTransferJob(String name) { super(name); setSystem(true); }
private synchronized void pauseIfPossible(IIncomingFileTransfer source) { if (isPaused() && !hasPaused) { pasuable = source.getAdapter(IFileTransferPausable.class); if (pasuable != null) pasuable.pause(); } }
/** * Check if the given exception represents that a switch to the JRE HTTP Client * is required. ECF sets the HTTP status code 477 to indicate this. * If the JRE HTTP client is required a JREHttpClientRequiredException is thrown. */ public static void checkJREHttpClientRequired(Throwable t) throws JREHttpClientRequiredException { if (t instanceof IncomingFileTransferException) { if (((IncomingFileTransferException) t).getErrorCode() == 477) throw new JREHttpClientRequiredException(); } else if (t instanceof BrowseFileTransferException) { if (((BrowseFileTransferException) t).getErrorCode() == 477) throw new JREHttpClientRequiredException(); } }
protected String createRangeName() { if (rangeSpecification == null) return ""; //$NON-NLS-1$ return "[" + rangeSpecification.getStartPosition() + "," + rangeSpecification.getEndPosition() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
protected void canceling() { request.cancel(); }
protected void fireTransferReceivePausedEvent() { listener.handleTransferEvent(new IIncomingFileTransferReceivePausedEvent() { public IIncomingFileTransfer getSource() { return AbstractRetrieveFileTransfer.this; } public String toString() { final StringBuffer sb = new StringBuffer("IIncomingFileTransferReceivePausedEvent["); //$NON-NLS-1$ sb.append("bytesReceived=").append(bytesReceived) //$NON-NLS-1$ .append(";fileLength=").append(fileLength).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ return sb.toString(); } }); }
protected void canceling() { fileTransfer.cancel(); } }
public long getFileLength() { return fileTransferInfo.getFileSize(); }
private synchronized void pauseIfPossible(IIncomingFileTransfer source) { if (isPaused() && !hasPaused) { pasuable = source.getAdapter(IFileTransferPausable.class); if (pasuable != null) pasuable.pause(); } }
/** * Check if the given exception represents that a switch to the JRE HTTP Client * is required. ECF sets the HTTP status code 477 to indicate this. * If the JRE HTTP client is required a JREHttpClientRequiredException is thrown. */ public static void checkJREHttpClientRequired(Throwable t) throws JREHttpClientRequiredException { if (t instanceof IncomingFileTransferException) { if (((IncomingFileTransferException) t).getErrorCode() == 477) throw new JREHttpClientRequiredException(); } else if (t instanceof BrowseFileTransferException) { if (((BrowseFileTransferException) t).getErrorCode() == 477) throw new JREHttpClientRequiredException(); } }
public synchronized boolean resume() { this.isPause = false; if (this.pasuable != null) { return this.pasuable.resume(); } return false; }
protected void fireTransferSendDataEvent() { listener.handleTransferEvent(new IOutgoingFileTransferSendDataEvent() { public IOutgoingFileTransfer getSource() { return AbstractOutgoingFileTransfer.this; } public String toString() { final StringBuffer sb = new StringBuffer("IOutgoingFileTransferSendDataEvent["); //$NON-NLS-1$ sb.append("bytesSent=").append(bytesSent) //$NON-NLS-1$ .append(";fileLength=").append(fileTransferInfo.getFileSize()) //$NON-NLS-1$ .append("]"); //$NON-NLS-1$ return sb.toString(); } }); }
/** * @param name the name for this file transfer job. Should not be <code>null</code>. */ public FileTransferJob(String name) { super(name); setSystem(true); }
protected void canceling() { fileTransfer.cancel(); } }
protected UserCancelledException newUserCancelledException() { return new UserCancelledException(Messages.AbstractRetrieveFileTransfer_Exception_User_Cancelled); }
private synchronized void pauseIfPossible(IIncomingFileTransfer source) { if (isPaused() && !hasPaused) { pasuable = source.getAdapter(IFileTransferPausable.class); if (pasuable != null) pasuable.pause(); } }
public synchronized boolean resume() { this.isPause = false; if (this.pasuable != null) { return this.pasuable.resume(); } return false; }
protected void fireTransferReceiveDataEvent() { listener.handleTransferEvent(new IIncomingFileTransferReceiveDataEvent() { public IIncomingFileTransfer getSource() { return AbstractRetrieveFileTransfer.this; } public String toString() { final StringBuffer sb = new StringBuffer("IIncomingFileTransferReceiveDataEvent["); //$NON-NLS-1$ sb.append("bytesReceived=").append(bytesReceived) //$NON-NLS-1$ .append(";fileLength=").append(fileLength) //$NON-NLS-1$ .append("]"); //$NON-NLS-1$ return sb.toString(); } }); }