Search in sources :

Example 11 with TorrentAttribute

use of com.biglybt.pif.torrent.TorrentAttribute in project BiglyBT by BiglySoftware.

the class ShareResourceImpl method serialiseResource.

protected void serialiseResource(Map map) {
    Iterator it = attributes.keySet().iterator();
    Map attrs = new HashMap();
    map.put("attributes", attrs);
    while (it.hasNext()) {
        TorrentAttribute ta = (TorrentAttribute) it.next();
        String value = (String) attributes.get(ta);
        try {
            if (value != null) {
                attrs.put(ta.getName(), value.getBytes(Constants.DEFAULT_ENCODING));
            }
        } catch (Throwable e) {
            Debug.printStackTrace(e);
        }
    }
}
Also used : TorrentAttribute(com.biglybt.pif.torrent.TorrentAttribute)

Aggregations

TorrentAttribute (com.biglybt.pif.torrent.TorrentAttribute)11 Torrent (com.biglybt.pif.torrent.Torrent)5 Download (com.biglybt.pif.download.Download)3 TOTorrent (com.biglybt.core.torrent.TOTorrent)2 DownloadAttributeListener (com.biglybt.pif.download.DownloadAttributeListener)2 ShareException (com.biglybt.pif.sharing.ShareException)2 TorrentManager (com.biglybt.pif.torrent.TorrentManager)2 ContentDownload (com.biglybt.core.content.ContentDownload)1 DownloadManager (com.biglybt.core.download.DownloadManager)1 DownloadManagerState (com.biglybt.core.download.DownloadManagerState)1 PEPeer (com.biglybt.core.peer.PEPeer)1 PEPeerManager (com.biglybt.core.peer.PEPeerManager)1 Tag (com.biglybt.core.tag.Tag)1 TOTorrentCreator (com.biglybt.core.torrent.TOTorrentCreator)1 TOTorrentException (com.biglybt.core.torrent.TOTorrentException)1 TRTrackerAnnouncerResponsePeer (com.biglybt.core.tracker.client.TRTrackerAnnouncerResponsePeer)1 AEThread (com.biglybt.core.util.AEThread)1 CopyOnWriteList (com.biglybt.core.util.CopyOnWriteList)1 MagnetURIHandler (com.biglybt.net.magneturi.MagnetURIHandler)1 MagnetURIHandlerException (com.biglybt.net.magneturi.MagnetURIHandlerException)1