public class TorrentClientBuilder<B extends TorrentClientBuilder> extends BaseClientBuilder<B>
Modifier | Constructor and Description |
---|---|
protected |
TorrentClientBuilder() |
Modifier and Type | Method and Description |
---|---|
B |
afterDownloaded(Consumer<Torrent> runnable)
Provide a callback to invoke when downloading has completed
|
B |
afterFileDownloaded(FileDownloadCompleteCallback callback)
Provide a callback to invoke when an individual file in the torrent has completed and verified
|
B |
afterFilesChosen(Runnable runnable)
Provide a callback to invoke when the files have been chosen
|
B |
afterTorrentFetched(Consumer<Torrent> torrentConsumer)
Provide a callback to invoke when torrent's metadata has been fetched.
|
protected ProcessingContext |
buildProcessingContext(BtRuntime runtime) |
protected <C extends ProcessingContext> |
collectStageListeners(ListenerSource<C> listenerSource) |
B |
fileSelector(FilePrioritySkipSelector fileSelector)
Provide a file selector for partial download of the torrent.
|
B |
magnet(MagnetUri magnetUri)
Set magnet URI
|
B |
magnet(String magnetUri)
Set magnet URI in BEP-9 format
|
B |
randomizedRarestSelector()
Use rarest first piece selection strategy
|
B |
rarestSelector()
Use rarest first piece selection strategy
|
B |
selector(PieceSelector pieceSelector)
Set piece selection strategy
|
B |
sequentialSelector()
Use sequential piece selection strategy
|
B |
stopWhenDownloaded()
Stop processing, when the data has been downloaded.
|
B |
storage(Storage storage)
Set the provided storage as the data back-end
|
B |
torrent(Supplier<Torrent> torrentSupplier)
Set custom torrent file supplier
|
B |
torrent(URL torrentUrl)
Set torrent file URL
|
build, initEagerly, runtime
public B torrent(URL torrentUrl)
torrent(Supplier)
public B torrent(Supplier<Torrent> torrentSupplier)
torrent(URL)
public B magnet(String magnetUri)
magnetUri
- Magnet URIMagnetUriParser
public B magnet(MagnetUri magnetUri)
magnetUri
- Magnet URIMagnetUriParser
public B selector(PieceSelector pieceSelector)
public B sequentialSelector()
public B rarestSelector()
public B randomizedRarestSelector()
public B stopWhenDownloaded()
public B afterTorrentFetched(Consumer<Torrent> torrentConsumer)
torrentConsumer
- Callback to invoke when torrent's metadata has been fetchedpublic B fileSelector(FilePrioritySkipSelector fileSelector)
fileSelector
- A file selector for partial download of the torrent.public B afterFilesChosen(Runnable runnable)
runnable
- Callback to invoke when the files have been chosenpublic B afterFileDownloaded(FileDownloadCompleteCallback callback)
callback
- The callback to invoke when an individual file in the torrent has fully downloadedpublic B afterDownloaded(Consumer<Torrent> runnable)
runnable
- Callback to invoke when downloading has completedprotected ProcessingContext buildProcessingContext(BtRuntime runtime)
buildProcessingContext
in class BaseClientBuilder<B extends TorrentClientBuilder>
protected <C extends ProcessingContext> void collectStageListeners(ListenerSource<C> listenerSource)
collectStageListeners
in class BaseClientBuilder<B extends TorrentClientBuilder>
Copyright © 2016–2021. All rights reserved.