diff options
author | slewis | 2008-03-04 01:26:28 +0000 |
---|---|---|
committer | slewis | 2008-03-04 01:26:28 +0000 |
commit | 756ff56b65a2c3b7c86d2f42e391141fe96a31c8 (patch) | |
tree | b8d15981cc7daea3b5f8b70191f644b330ae638b /providers | |
parent | 0850308fe3ddad0a4fa4f68fe04d81aa74787632 (diff) | |
download | org.eclipse.ecf-756ff56b65a2c3b7c86d2f42e391141fe96a31c8.tar.gz org.eclipse.ecf-756ff56b65a2c3b7c86d2f42e391141fe96a31c8.tar.xz org.eclipse.ecf-756ff56b65a2c3b7c86d2f42e391141fe96a31c8.zip |
API addition and provider implementation changes for bug 221177. Also added GetRemoteFileNameTest.
Diffstat (limited to 'providers')
-rw-r--r-- | providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentFileTransfer.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentFileTransfer.java index a0dfb0033..d642b911e 100644 --- a/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentFileTransfer.java +++ b/providers/bundles/org.eclipse.ecf.provider.bittorrent/src/org/eclipse/ecf/internal/provider/bittorrent/TorrentFileTransfer.java @@ -196,7 +196,19 @@ final class TorrentFileTransfer implements IFileTransferPausable, IFileTransferR } public long getFileLength() { - return -1; + return torrent.getTorrentFile().getTotalLength(); + } + + /* (non-Javadoc) + * @see org.eclipse.ecf.filetransfer.IIncomingFileTransfer#getRemoteFileName() + */ + public String getRemoteFileName() { + if (torrent == null) + return null; + if (!torrent.getTorrentFile().isMultiFile()) { + return torrent.getTorrentFile().getFilenames()[0]; + } + return null; } } |