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

📄 staticutilities.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:   StaticUtilities.java

package org.gudy.azureus2.plugins.utils;

import com.aelitis.azureus.core.AzureusCore;
import com.aelitis.azureus.core.AzureusCoreFactory;
import java.io.InputStream;
import org.gudy.azureus2.core3.util.AESemaphore;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.PluginInterface;
import org.gudy.azureus2.plugins.PluginManager;
import org.gudy.azureus2.plugins.ui.*;
import org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloaderFactory;
import org.gudy.azureus2.plugins.utils.resourceuploader.ResourceUploaderFactory;
import org.gudy.azureus2.plugins.utils.xml.rss.RSSFeed;
import org.gudy.azureus2.plugins.utils.xml.simpleparser.SimpleXMLParserDocumentException;
import org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderFactoryImpl;
import org.gudy.azureus2.pluginsimpl.local.utils.resourceuploader.ResourceUploaderFactoryImpl;

// Referenced classes of package org.gudy.azureus2.plugins.utils:
//			Formatters, Utilities

public class StaticUtilities
{

	private static Formatters formatters;

	public StaticUtilities()
	{
	}

	public static Formatters getFormatters()
	{
		return formatters;
	}

	public static ResourceDownloaderFactory getResourceDownloaderFactory()
	{
		return ResourceDownloaderFactoryImpl.getSingleton();
	}

	public static ResourceUploaderFactory getResourceUploaderFactory()
	{
		return ResourceUploaderFactoryImpl.getSingleton();
	}

	public static PluginInterface getDefaultPluginInterface()
	{
		return AzureusCoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface();
	}

	public static RSSFeed getRSSFeed(InputStream is)
		throws SimpleXMLParserDocumentException
	{
		return getDefaultPluginInterface().getUtilities().getRSSFeed(is);
	}

	public static int promptUser(String title, String desc, String options[], int default_option)
	{
		UIInstance instances[] = getDefaultPluginInterface().getUIManager().getUIInstances();
		if (instances.length > 0)
		{
			return instances[0].promptUser(title, desc, options, default_option);
		} else
		{
			Debug.out((new StringBuilder()).append("No UIInstances to handle prompt: ").append(title).append("/").append(desc).toString());
			return -1;
		}
	}

	public static UIManager getUIManager(long millis_to_wait_for_attach)
	{
		UIManager ui_manager;
label0:
		{
			ui_manager = getDefaultPluginInterface().getUIManager();
			if (ui_manager.getUIInstances().length != 0)
				break label0;
			AESemaphore sem = new AESemaphore("waitforui");
			ui_manager.addUIListener(new UIManagerListener(ui_manager, sem) {

				final UIManager val$ui_manager;
				final AESemaphore val$sem;

				public void UIAttached(UIInstance instance)
				{
					ui_manager.removeUIListener(this);
					sem.releaseForever();
				}

				public void UIDetached(UIInstance uiinstance)
				{
				}

			
			{
				ui_manager = uimanager;
				sem = aesemaphore;
				super();
			}
			});
			long time_to_go = millis_to_wait_for_attach;
			do
			{
				if (ui_manager.getUIInstances().length != 0 || sem.reserve(1000L))
					break label0;
				time_to_go -= 1000L;
			} while (time_to_go > 0L);
			Debug.out("Timeout waiting for UI to attach");
		}
		return ui_manager;
	}

	static 
	{
		try
		{
			Class c = Class.forName("org.gudy.azureus2.pluginsimpl.local.utils.FormattersImpl");
			formatters = (Formatters)c.newInstance();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

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