DownloadManager[] dms = SelectedContentManager.getDMSFromSelectedContent();
for (DownloadManager dm : dms) {
if (dm != null) {
Map<String, Object> mapDM = new HashMap<String, Object>();
TOTorrent torrent = dm.getTorrent();
if (torrent != null && !TorrentUtils.isReallyPrivate(torrent)) {
try {
// make a copy of the torrent
Map torrent_map = torrent.serialiseToMap();
TOTorrent torrent_to_send = TOTorrentFactory.deserialiseFromMap( torrent_map );
Map vuze_map = (Map)torrent_map.get( "vuze" );
// remove any non-standard stuff (e.g. resume data)
torrent_to_send.removeAdditionalProperties();
torrent_map = torrent_to_send.serialiseToMap();
if ( vuze_map != null ){
torrent_map.put( "vuze", vuze_map );
}
byte[] encode = BEncoder.encode(torrent_map);