⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 java 文件下载器。可自定义
💻 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:   Main.java

package org.gudy.azureus2.ui.jws;

import com.aelitis.azureus.launcher.Launcher;
import java.io.PrintStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;
import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.*;
import org.gudy.azureus2.plugins.download.DownloadManager;
import org.gudy.azureus2.plugins.logging.*;

public class Main
	implements Plugin, PluginListener, PluginEventListener
{

	protected static Main singleton;
	protected static AESemaphore init_sem = new AESemaphore("UIJWS");
	private static AEMonitor class_mon = new AEMonitor("UIJWS");
	protected PluginInterface plugin_interface;
	protected LoggerChannel log;
	protected AESemaphore ready_sem;

	public Main()
	{
		ready_sem = new AESemaphore("UIJWSReady");
	}

	public static Main getSingleton(String args[])
	{
		Main main1;
		class_mon.enter();
		if (singleton == null)
		{
			(new AEThread("plugin initialiser ") {

				public void runSupport()
				{
					PluginManager.registerPlugin(org/gudy/azureus2/ui/jws/Main);
					Properties props = new Properties();
					props.put("MULTI_INSTANCE", "false");
					PluginManager.startAzureus(1, props);
				}

			}).start();
			init_sem.reserve();
		}
		main1 = singleton;
		class_mon.exit();
		return main1;
		Exception exception;
		exception;
		class_mon.exit();
		throw exception;
	}

	public void initialize(PluginInterface _pi)
	{
		plugin_interface = _pi;
		singleton = this;
		log = plugin_interface.getLogger().getChannel("JWS Launcher");
		log.addListener(new LoggerChannelListener() {

			final Main this$0;

			public void messageLogged(int type, String content)
			{
				System.out.println(content);
			}

			public void messageLogged(String str, Throwable error)
			{
				System.out.println(str);
				Debug.printStackTrace(error);
			}

			
			{
				this$0 = Main.this;
				super();
			}
		});
		log.log(1, "Plugin Initialised");
		plugin_interface.addListener(this);
		plugin_interface.addEventListener(this);
		init_sem.release();
	}

	public void initializationComplete()
	{
	}

	public void handleEvent(PluginEvent ev)
	{
		System.out.println((new StringBuilder()).append("PluginEvent:").append(ev.getType()).toString());
		if (ev.getType() == 2)
			ready_sem.release();
	}

	protected void process()
	{
		ready_sem.reserve();
		log.log(1, "processing jws request");
		Properties props = System.getProperties();
		String key;
		for (Enumeration enumx = props.keys(); enumx.hasMoreElements(); log.log(1, (new StringBuilder()).append("\t").append(key).append(" = '").append(props.get(key)).append("'").toString()))
			key = (String)enumx.nextElement();

		String torrent_url = (String)props.get("azureus.javaws.torrent_url");
		log.log(1, (new StringBuilder()).append("Torrent URL = ").append(torrent_url).toString());
		if (torrent_url != null)
			try
			{
				plugin_interface.getDownloadManager().addDownload(new URL(torrent_url));
			}
			catch (Throwable e)
			{
				log.log(e);
			}
	}

	public void closedownInitiated()
	{
	}

	public void closedownComplete()
	{
	}

	public static void main(String args[])
	{
		if (Launcher.checkAndLaunch(org/gudy/azureus2/ui/jws/Main, args))
		{
			return;
		} else
		{
			getSingleton(args).process();
			return;
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -