📄 importtorrentwizard.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: ImportTorrentWizard.java
package org.gudy.azureus2.ui.swt.importtorrent.wizard;
import com.aelitis.azureus.core.AzureusCore;
import java.io.File;
import java.io.IOException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.torrent.*;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.core3.util.TorrentUtils;
import org.gudy.azureus2.ui.swt.wizard.Wizard;
// Referenced classes of package org.gudy.azureus2.ui.swt.importtorrent.wizard:
// ImportTorrentWizardInputPanel
public class ImportTorrentWizard extends Wizard
{
String torrent_file;
String import_file;
public ImportTorrentWizard(AzureusCore azureus_core, Display display)
{
Wizard(azureus_core, "importTorrentWizard.title");
torrent_file = "";
import_file = "";
ImportTorrentWizardInputPanel input_panel = new ImportTorrentWizardInputPanel(this, null);
setFirstPanel(input_panel);
}
public void onClose()
{
onClose();
}
protected void setTorrentFile(String str)
{
torrent_file = str;
}
protected String getTorrentFile()
{
return torrent_file;
}
protected void setImportFile(String str)
{
import_file = str;
torrent_file = (new StringBuilder()).append(str).append(".torrent").toString();
}
protected String getImportFile()
{
return import_file;
}
protected boolean performImport()
{
File input_file;
File output_file;
try
{
input_file = (new File(getImportFile())).getCanonicalFile();
}
catch (IOException e)
{
MessageBox mb = new MessageBox(getWizardWindow(), 33);
mb.setText(MessageText.getString("importTorrentWizard.process.inputfilebad.title"));
mb.setMessage((new StringBuilder()).append(MessageText.getString("importTorrentWizard.process.inputfilebad.message")).append("\n").append(e.toString()).toString());
mb.open();
return false;
}
output_file = new File(getTorrentFile());
if (output_file.exists())
{
MessageBox mb = new MessageBox(getWizardWindow(), 196);
mb.setText(MessageText.getString("importTorrentWizard.process.outputfileexists.title"));
mb.setMessage(MessageText.getString("importTorrentWizard.process.outputfileexists.message"));
int result = mb.open();
if (result == 128)
return false;
}
TOTorrent torrent = TOTorrentFactory.deserialiseFromXMLFile(input_file);
torrent.serialiseToBEncodedFile(output_file);
return true;
TOTorrentException e;
e;
String error_title;
String error_detail;
error_title = MessageText.getString("importTorrentWizard.process.torrentfail.title");
error_detail = TorrentUtils.exceptionToText(e);
break MISSING_BLOCK_LABEL_223;
e;
error_title = MessageText.getString("importTorrentWizard.process.importfail.title");
error_detail = TorrentUtils.exceptionToText(e);
break MISSING_BLOCK_LABEL_223;
Throwable e;
e;
error_title = MessageText.getString("importTorrentWizard.process.unknownfail.title");
Debug.printStackTrace(e);
error_detail = e.toString();
MessageBox mb = new MessageBox(getWizardWindow(), 33);
mb.setText(error_title);
mb.setMessage(error_detail);
mb.open();
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -