| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Torrent |
build()
Creates a torrent without metadata information (the .torrent file is not present).
|
Torrent |
buildFromMetata(File metadata,
File downloadFolder)
Creates a torrent with metadata information (the .torrent file is present).
|
boolean |
canDownload()
This method check if
setHash(byte[]) has been called as depending on the configured BEPs that requirements
before something is 'downloadable' changes. |
Torrent.Builder |
setHash(byte[] hash)
Sets the hash of the torrent.
|
Torrent.Builder |
setName(String name)
Sets the display name for this torrent.
|
Torrent.Builder |
setTorrentClient(TorrentClient torrentClient)
Sets the torrent client on which this torrent will be registered.
|
public Torrent.Builder setTorrentClient(TorrentClient torrentClient)
torrentClient - The client.public Torrent.Builder setHash(byte[] hash)
hash - The expected hash.public Torrent.Builder setName(String name)
name - The name to set.public boolean canDownload()
setHash(byte[]) has been called as depending on the configured BEPs that requirements
before something is 'downloadable' changes.true if the hash has been set.public Torrent build()
public Torrent buildFromMetata(File metadata, File downloadFolder) throws IOException
metadata - The metadata file to provision this torrent instance with.downloadFolder - The folder in which the torrent should be downloaded.IOException - When the metadata file cannot be read.Copyright © 2016. All rights reserved.