Methods Summary |
---|
public static boolean | isPublishComplete(org.gudy.azureus2.core3.download.DownloadManager dm)
Map mapAttr = dm.getDownloadState().getMapAttribute(CONTENTMAP_KEY);
if ( mapAttr == null ){
return( false );
}
Long complete = (Long)mapAttr.get( COMPLETE_ATTRIBUTE_KEY );
return( complete != null );
|
public static boolean | isPublished(org.gudy.azureus2.core3.download.DownloadManager dm)
if (dm == null) {
return false;
}
try {
Map mapAttr = dm.getDownloadState().getMapAttribute(CONTENTMAP_KEY);
return mapAttr != null
&& mapAttr.containsKey(PublishTransaction.PUBLISH_ATTRIBUTE_KEY);
} catch (Exception e) {
Debug.out("baH", e);
}
return false;
|
public static boolean | isPublished(org.gudy.azureus2.plugins.download.Download download)
if (download instanceof DownloadImpl) {
return isPublished(((DownloadImpl) download).getDownload());
}
return false;
|
public static void | setPublishComplete(org.gudy.azureus2.core3.download.DownloadManager dm)
try {
Map mapAttr = dm.getDownloadState().getMapAttribute(CONTENTMAP_KEY);
if ( mapAttr == null ){
mapAttr = new HashMap();
}
mapAttr.put( COMPLETE_ATTRIBUTE_KEY, new Long(1));
dm.getDownloadState().setMapAttribute(CONTENTMAP_KEY, mapAttr);
} catch (Exception e) {
Debug.out("baH", e);
}
|
public static void | setPublished(org.gudy.azureus2.plugins.torrent.Torrent torrent)
if (torrent instanceof TorrentImpl) {
setPublished(((TorrentImpl) torrent).getTorrent());
}
|
public static void | setPublished(org.gudy.azureus2.core3.torrent.TOTorrent torrent)
try {
if (torrent == null) {
return;
}
Map map = torrent.getAdditionalMapProperty("attributes");
if (map != null) {
Map mapAttr = (Map) map.get(CONTENTMAP_KEY);
mapAttr.put(PublishTransaction.PUBLISH_ATTRIBUTE_KEY, new Long(1));
}
} catch (Exception e) {
Debug.out("baH", e);
}
|
public static void | setPublished(org.gudy.azureus2.core3.download.DownloadManager dm, boolean isPublishedContent)
if (isPublishedContent) {
setPublished(dm);
return;
}
try {
Map mapAttr = dm.getDownloadState().getMapAttribute(CONTENTMAP_KEY);
if (mapAttr == null) {
return;
}
mapAttr = new HashMap(mapAttr);
Object remove = mapAttr.remove(PublishTransaction.PUBLISH_ATTRIBUTE_KEY);
if (remove != null) {
dm.getDownloadState().setMapAttribute(CONTENTMAP_KEY, mapAttr);
}
} catch (Exception e) {
Debug.out(e);
}
|
public static void | setPublished(org.gudy.azureus2.core3.download.DownloadManager dm)
try {
Map mapAttr = dm.getDownloadState().getMapAttribute(CONTENTMAP_KEY);
if (mapAttr == null) {
mapAttr = new HashMap();
} else {
mapAttr = new HashMap(mapAttr);
}
mapAttr.put(PublishTransaction.PUBLISH_ATTRIBUTE_KEY, new Long(1));
dm.getDownloadState().setMapAttribute(CONTENTMAP_KEY, mapAttr);
} catch (Exception e) {
Debug.out("baH", e);
}
|
public static void | setPublished(org.gudy.azureus2.plugins.download.Download download)
if (download instanceof DownloadImpl) {
setPublished(((DownloadImpl) download).getDownload());
}
|
public static void | setupContext(com.aelitis.azureus.core.messenger.ClientMessageContext context)
context.registerTransactionType("publish", PublishTransaction.class);
context.addMessageListener(new SeedingListener());
|