Package org.johnnei.javatorrent.torrent
Class Torrent.Builder
- java.lang.Object
-
- org.johnnei.javatorrent.torrent.Torrent.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Torrentbuild()Creates a torrent without metadata information (the .torrent file is not present).booleancanDownload()Torrent.BuildersetDownloadFolder(File downloadFolder)Torrent.BuildersetMetadata(Metadata metadata)Torrent.BuildersetName(String name)Sets the display name for this torrent.Torrent.BuildersetTorrentClient(TorrentClient torrentClient)Sets the torrent client on which this torrent will be registered.
-
-
-
Method Detail
-
setTorrentClient
public Torrent.Builder setTorrentClient(TorrentClient torrentClient)
Sets the torrent client on which this torrent will be registered.- Parameters:
torrentClient- The client.- Returns:
- The adjusted builder.
-
setName
public Torrent.Builder setName(String name)
Sets the display name for this torrent.- Parameters:
name- The name to set.- Returns:
- The adjusted builder.
-
setMetadata
public Torrent.Builder setMetadata(Metadata metadata)
-
setDownloadFolder
public Torrent.Builder setDownloadFolder(File downloadFolder)
-
canDownload
public boolean canDownload()
- Returns:
trueif the hash of the metadata is available.
-
build
public Torrent build()
Creates a torrent without metadata information (the .torrent file is not present).- Returns:
- The newly created torrent.
-
-