Search in sources :

Example 11 with Torrent

use of com.turn.ttorrent.common.Torrent in project teamcity-torrent-plugin by JetBrains.

the class TorrentsSeederTest method createTorrentFromFile.

private File createTorrentFromFile(File srcFile, File torrentDir) throws InterruptedException, NoSuchAlgorithmException, IOException {
    File torrentFile = new File(torrentDir, srcFile.getName() + ".torrent");
    final Torrent torrent = TorrentCreator.create(srcFile, myTracker.getAnnounceURI(), "Test");
    TorrentUtil.saveTorrentToFile(torrent, torrentFile);
    return torrentFile;
}
Also used : Torrent(com.turn.ttorrent.common.Torrent) File(java.io.File)

Aggregations

Torrent (com.turn.ttorrent.common.Torrent)11 File (java.io.File)8 AnnounceableTorrent (com.turn.ttorrent.common.AnnounceableTorrent)5 IOException (java.io.IOException)5 AnnounceableFileTorrent (com.turn.ttorrent.common.AnnounceableFileTorrent)4 Tracker (com.turn.ttorrent.tracker.Tracker)3 ArrayList (java.util.ArrayList)3 Nullable (org.jetbrains.annotations.Nullable)3 Client (com.turn.ttorrent.client.Client)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 HttpClient (org.apache.commons.httpclient.HttpClient)2 WaitFor (com.intellij.util.WaitFor)1 SharedTorrent (com.turn.ttorrent.client.SharedTorrent)1 ExecutorService (java.util.concurrent.ExecutorService)1 BuildArtifact (jetbrains.buildServer.serverSide.artifacts.BuildArtifact)1 WaitFor (jetbrains.buildServer.util.WaitFor)1 Mock (org.jmock.Mock)1 Constraint (org.jmock.core.Constraint)1