Package org.eclipse.ecf.filetransfer

Examples of org.eclipse.ecf.filetransfer.IRetrieveFileTransferContainerAdapter


      Assert.assertEquals(0, socketEvents.size());
    }

    private Object canAdaptTo(ISocketEventSource source) {
      IRetrieveFileTransferContainerAdapter receive = (IRetrieveFileTransferContainerAdapter) source
          .getAdapter(IRetrieveFileTransferContainerAdapter.class);
      if (receive != null) {
        canAdaptTo(source, receive, new Class[] {
            IRetrieveFileTransfer.class,
            IIncomingFileTransfer.class, IFileTransfer.class });
View Full Code Here


      } catch (final MalformedURLException e1) {
        throw new IncomingFileTransferException(Messages.AbstractRetrieveFileTransfer_MalformedURLException);
      }
    }

    IRetrieveFileTransferContainerAdapter fileTransfer = Activator.getDefault().getFileTransfer(protocol);

    // We will default to JRE-provided file transfer if nothing else
    // available
    // for given protocol
    if (fileTransfer == null)
      fileTransfer = new UrlConnectionRetrieveFileTransfer();

    // Set connect context
    fileTransfer.setConnectContextForAuthentication(connectContext);
    // Set Proxy
    fileTransfer.setProxy(proxy);

    // send request using given file transfer protocol
    fileTransfer.sendRetrieveRequest(remoteFileID, transferListener, options);

  }
View Full Code Here

      } catch (final MalformedURLException e1) {
        throw new IncomingFileTransferException(Messages.AbstractRetrieveFileTransfer_MalformedURLException);
      }
    }

    IRetrieveFileTransferContainerAdapter fileTransfer = Activator.getDefault().getFileTransfer(protocol);

    // We will default to JRE-provided file transfer if nothing else
    // available
    // for given protocol
    if (fileTransfer == null)
      fileTransfer = new UrlConnectionRetrieveFileTransfer();

    // Set connect context
    fileTransfer.setConnectContextForAuthentication(connectContext);
    // Set Proxy
    fileTransfer.setProxy(proxy);

    // send request using given file transfer protocol
    fileTransfer.sendRetrieveRequest(remoteFileID, rangeSpecification, transferListener, options);

  }
View Full Code Here

    setWindowTitle(Messages.getString("BitTorrentConnectWizardPage.File_Sharing.Title"));
  }

  public boolean performFinish() {
    workbenchPage = workbench.getActiveWorkbenchWindow().getActivePage();
    final IRetrieveFileTransferContainerAdapter irftca = (IRetrieveFileTransferContainerAdapter) container.getAdapter(IRetrieveFileTransferContainerAdapter.class);
    try {
      targetID = FileIDFactory.getDefault().createFileID(irftca.getRetrieveNamespace(), page.getTorrentName());
    } catch (final FileCreateException e) {
      new ContainerConnectErrorDialog(workbench.getActiveWorkbenchWindow().getShell(), 1, "The target ID to connect to could not be created", page.getTorrentName(), e).open();
      return true;
    }

    try {
      irftca.sendRetrieveRequest(targetID, new IFileTransferListener() {
        public void handleTransferEvent(final IFileTransferEvent e) {
          if (e instanceof IIncomingFileTransferReceiveStartEvent) {
            try {
              final IFileTransfer ift = ((IIncomingFileTransferReceiveStartEvent) e).receive(new File(page.getTargetName()));
              workbenchPage.getWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() {
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.filetransfer.IRetrieveFileTransferContainerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.