Closed Peterppan closed 5 years ago
use MetadataBuilder
class
simple example:
byte[] torrentMetadataBytes = new MetadataBuilder()
.addDataSource(new ByteArrayInputStream(new byte[]{1,2,3}), "singleFile.txt", true)
.setTracker("http://localhost:12346")
.buildBinary();
For adding local files you can use addFile
method instead of addDataSource
Thank you very much for your answer,but i have confused about the other client how to download the shared files. When i create the .torrent file with the MetadataBuilder class, and which client be the seeder frist?
I create a .torrent file and use client download it,but the tracker allways get the request event NONE. how can i fix it?
2019-07-22 14:18:18,026 [Dispatcher-4 ] WARN : RequestEvent event: NONE 2019-07-22 14:18:18,026 [Dispatcher-4 ] WARN : peer!!
Looks like you created a separate issue for this question. Ask me there
how to cteate a .torrent file from the client?