📄 torrentdownloaderimpl.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: TorrentDownloaderImpl.java
package org.gudy.azureus2.pluginsimpl.local.torrent;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import org.gudy.azureus2.core3.logging.*;
import org.gudy.azureus2.core3.torrent.TOTorrentFactory;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.torrent.*;
import org.gudy.azureus2.plugins.utils.resourcedownloader.*;
import org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderFactoryImpl;
// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.torrent:
// TorrentImpl, TorrentManagerImpl
public class TorrentDownloaderImpl
implements TorrentDownloader
{
private static final LogIDs LOGID;
protected TorrentManagerImpl manager;
protected URL url;
protected ResourceDownloader downloader;
protected boolean encoding_requested;
protected String requested_encoding;
protected boolean set_encoding;
protected TorrentDownloaderImpl(TorrentManagerImpl _manager, URL _url)
{
manager = _manager;
url = _url;
downloader = ResourceDownloaderFactoryImpl.getSingleton().create(url);
}
protected TorrentDownloaderImpl(TorrentManagerImpl _manager, URL _url, String _user_name, String _password)
{
manager = _manager;
url = _url;
set_encoding = true;
downloader = ResourceDownloaderFactoryImpl.getSingleton().create(url, _user_name, _password);
downloader.addListener(new ResourceDownloaderAdapter() {
final TorrentDownloaderImpl this$0;
public void reportActivity(ResourceDownloader downloader, String activity)
{
if (Logger.isEnabled())
Logger.log(new LogEvent(TorrentDownloaderImpl.LOGID, (new StringBuilder()).append("TorrentDownloader:").append(activity).toString()));
}
{
this$0 = TorrentDownloaderImpl.this;
super();
}
});
}
public Torrent download()
throws TorrentException
{
InputStream is;
Exception exception;
is = null;
TorrentImpl torrentimpl;
try
{
is = downloader.download();
org.gudy.azureus2.core3.torrent.TOTorrent torrent = TOTorrentFactory.deserialiseFromBEncodedInputStream(is);
if (encoding_requested)
manager.tryToSetTorrentEncoding(torrent, requested_encoding);
else
if (set_encoding)
manager.tryToSetDefaultTorrentEncoding(torrent);
torrentimpl = new TorrentImpl(torrent);
}
catch (TorrentException e)
{
throw e;
}
catch (Throwable e)
{
throw new TorrentException("TorrentDownloader: download fails", e);
}
finally
{
if (is == null) goto _L0; else goto _L0
}
if (is != null)
try
{
is.close();
}
catch (IOException e)
{
Debug.printStackTrace(e);
}
return torrentimpl;
try
{
is.close();
}
catch (IOException e)
{
Debug.printStackTrace(e);
}
throw exception;
}
public Torrent download(String encoding)
throws TorrentException
{
encoding_requested = true;
requested_encoding = encoding;
return download();
}
static
{
LOGID = LogIDs.PLUGIN;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -