📄 globalmanagerhostsupport.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: GlobalManagerHostSupport.java
package org.gudy.azureus2.core3.global.impl;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.gudy.azureus2.core3.download.DownloadManager;
import org.gudy.azureus2.core3.global.GlobalManager;
import org.gudy.azureus2.core3.torrent.TOTorrent;
import org.gudy.azureus2.core3.torrent.TOTorrentException;
import org.gudy.azureus2.core3.tracker.host.*;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.core3.util.TorrentUtils;
class GlobalManagerHostSupport
implements TRHostTorrentFinder
{
protected GlobalManager gm;
protected TRHost host;
protected GlobalManagerHostSupport(GlobalManager _gm)
{
gm = _gm;
host = TRHostFactory.getSingleton();
host.initialise(this);
}
public TOTorrent lookupTorrent(byte hash[])
{
List managers;
int i;
managers = gm.getDownloadManagers();
i = 0;
_L3:
if (i >= managers.size()) goto _L2; else goto _L1
_L1:
TOTorrent t;
DownloadManager dm = (DownloadManager)managers.get(i);
t = dm.getTorrent();
if (t == null)
continue; /* Loop/switch isn't completed */
if (Arrays.equals(hash, t.getHash()))
return t;
continue; /* Loop/switch isn't completed */
TOTorrentException e;
e;
Debug.printStackTrace(e);
i++;
goto _L3
_L2:
return null;
}
protected void torrentRemoved(String torrent_file_str, TOTorrent torrent)
{
TRHostTorrent host_torrent = host.getHostTorrent(torrent);
if (host_torrent != null)
{
File torrent_file = new File(torrent_file_str);
if (torrent_file.exists())
try
{
TorrentUtils.writeToFile(host_torrent.getTorrent(), torrent_file, false);
host_torrent.setPassive(true);
}
catch (Throwable e)
{
Debug.out((new StringBuilder()).append("Failed to make torrent '").append(torrent_file_str).append("' passive: ").append(Debug.getNestedExceptionMessage(e)).toString());
}
}
}
protected void destroy()
{
host.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -