Package org.eclipse.ecf.protocol.bittorrent

Examples of org.eclipse.ecf.protocol.bittorrent.Torrent


          throw new IOException("file="+localFileToSave.getAbsolutePath()+" does not exist or cannot be written to"); //$NON-NLS-1$ //$NON-NLS-2$
        }

        final TorrentFile file = new TorrentFile(((TorrentID) remoteFileReference).getFile());
        file.setTargetFile(localFileToSave);
        final Torrent torrent = TorrentFactory.createTorrent(file);
        transfer = new TorrentFileTransfer(remoteFileReference, transferListener, torrent);
        return transfer;
      }

      public IIncomingFileTransfer receive(File localFileToSave, FileTransferJob fileTransferJob) throws IOException {
        if (cancelled) {
          throw new RuntimeException(new UserCancelledException());
        }

        Assert.isNotNull(localFileToSave, "localFileToSave must not be null"); //$NON-NLS-1$

        if (localFileToSave.exists() && !localFileToSave.canWrite()) {
          throw new IOException("file="+localFileToSave.getAbsolutePath()+" does not exist or cannot be written to"); //$NON-NLS-1$ //$NON-NLS-2$
        }

        final TorrentFile file = new TorrentFile(((TorrentID) remoteFileReference).getFile());
        file.setTargetFile(localFileToSave);
        final Torrent torrent = TorrentFactory.createTorrent(file);
        transfer = new TorrentFileTransfer(remoteFileReference, transferListener, torrent);
        return transfer;
      }

      public void cancel() {
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.protocol.bittorrent.Torrent

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.