public void removeTorrent ( String torrentHash ) { logger . debug ( "Stopping seeding " + torrentHash ) ; final Pair < SharedTorrent , LoadedTorrent > torrents = torrentsStorage . remove ( torrentHash ) ; SharedTorrent torrent = torrents . first ( ) ; if ( torrent != null ) { torrent . setClientState ( ClientState . DONE ) ; torrent . closeFully ( ) ; } List < SharingPeer > peers = getPeersForTorrent ( torrentHash ) ; for ( SharingPeer peer : peers ) { peer . unbind ( true ) ; } sendStopEvent ( torrents . second ( ) , torrentHash ) ; }
Removes specified torrent from storage .