BtClientBuilder
, StandaloneClientBuilder
public class TorrentClientBuilder<B extends TorrentClientBuilder> extends BaseClientBuilder<B>
Modifier | Constructor | Description |
---|---|---|
protected |
TorrentClientBuilder() |
Modifier and Type | Method | Description |
---|---|---|
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(TorrentFileSelector 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(URL torrentUrl) |
Set torrent file URL
|
B |
torrent(Supplier<Torrent> torrentSupplier) |
Set custom torrent file supplier
|
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(TorrentFileSelector 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 chosenprotected 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–2020. All rights reserved.