📄 exporttorrentwizard.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: ExportTorrentWizard.java
package org.gudy.azureus2.ui.swt.exporttorrent.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.download.DownloadManager;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.torrent.*;
import org.gudy.azureus2.core3.util.TorrentUtils;
import org.gudy.azureus2.ui.swt.wizard.Wizard;
// Referenced classes of package org.gudy.azureus2.ui.swt.exporttorrent.wizard:
// ExportTorrentWizardInputPanel, ExportTorrentWizardOutputPanel
public class ExportTorrentWizard extends Wizard
{
String torrent_file;
String export_file;
public ExportTorrentWizard(AzureusCore azureus_core, Display display)
{
Wizard(azureus_core, "exportTorrentWizard.title");
torrent_file = "";
export_file = "";
ExportTorrentWizardInputPanel input_panel = new ExportTorrentWizardInputPanel(this, null);
setFirstPanel(input_panel);
}
public ExportTorrentWizard(AzureusCore azureus_core, Display display, DownloadManager dm)
{
Wizard(azureus_core, "exportTorrentWizard.title");
torrent_file = "";
export_file = "";
setTorrentFile(dm.getTorrentFileName());
ExportTorrentWizardOutputPanel output_panel = new ExportTorrentWizardOutputPanel(this, null);
setFirstPanel(output_panel);
}
public void onClose()
{
onClose();
}
protected void setTorrentFile(String str)
{
torrent_file = str;
export_file = (new StringBuilder()).append(str).append(".xml").toString();
}
protected String getTorrentFile()
{
return torrent_file;
}
protected void setExportFile(String str)
{
export_file = str;
}
protected String getExportFile()
{
return export_file;
}
protected boolean performExport()
{
File input_file;
File output_file;
try
{
input_file = (new File(getTorrentFile())).getCanonicalFile();
}
catch (IOException e)
{
MessageBox mb = new MessageBox(getWizardWindow(), 33);
mb.setText(MessageText.getString("exportTorrentWizard.process.inputfilebad.title"));
mb.setMessage((new StringBuilder()).append(MessageText.getString("exportTorrentWizard.process.inputfilebad.message")).append("\n").append(e.toString()).toString());
mb.open();
return false;
}
output_file = new File(export_file);
if (output_file.exists())
{
MessageBox mb = new MessageBox(getWizardWindow(), 196);
mb.setText(MessageText.getString("exportTorrentWizard.process.outputfileexists.title"));
mb.setMessage(MessageText.getString("exportTorrentWizard.process.outputfileexists.message"));
int result = mb.open();
if (result == 128)
return false;
}
TOTorrent torrent = TOTorrentFactory.deserialiseFromBEncodedFile(input_file);
torrent.serialiseToXMLFile(output_file);
return true;
TOTorrentException e;
e;
String error_title;
String error_detail;
error_title = MessageText.getString("exportTorrentWizard.process.exportfail.title");
error_detail = TorrentUtils.exceptionToText(e);
break MISSING_BLOCK_LABEL_218;
e;
error_title = MessageText.getString("exportTorrentWizard.process.torrentfail.title");
error_detail = TorrentUtils.exceptionToText(e);
break MISSING_BLOCK_LABEL_218;
Throwable e;
e;
error_title = MessageText.getString("exportTorrentWizard.process.unknownfail.title");
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 + -