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

📄 platformmanagerimpl.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:   PlatformManagerImpl.java

package org.gudy.azureus2.platform.unix;

import java.io.File;
import java.io.PrintStream;
import java.net.InetAddress;
import java.util.HashSet;
import org.gudy.azureus2.core3.logging.*;
import org.gudy.azureus2.core3.util.AEMonitor;
import org.gudy.azureus2.core3.util.SystemProperties;
import org.gudy.azureus2.platform.*;
import org.gudy.azureus2.plugins.platform.PlatformManagerException;

public class PlatformManagerImpl
	implements PlatformManager
{

	private static final LogIDs LOGID;
	private static final String ERR_UNSUPPORTED = "Unsupported capability called on platform manager";
	protected static PlatformManagerImpl singleton;
	protected static AEMonitor class_mon = new AEMonitor("PlatformManager");
	private final HashSet capabilitySet = new HashSet();
	private static final Object migrate_lock = new Object();

	public static PlatformManagerImpl getSingleton()
	{
		return singleton;
	}

	private static void initializeSingleton()
	{
		class_mon.enter();
		singleton = new PlatformManagerImpl();
		class_mon.exit();
		break MISSING_BLOCK_LABEL_60;
		Throwable e;
		e;
		Logger.log(new LogEvent(LOGID, "Failed to initialize platform manager for Unix Compatable OS", e));
		class_mon.exit();
		break MISSING_BLOCK_LABEL_60;
		Exception exception;
		exception;
		class_mon.exit();
		throw exception;
	}

	public PlatformManagerImpl()
	{
		capabilitySet.add(PlatformManagerCapabilities.GetUserDataDirectory);
	}

	public void copyFilePermissions(String from_file_name, String to_file_name)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void createProcess(String command_line, boolean inherit_handles)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void dispose()
	{
	}

	public String getApplicationCommandLine()
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public int getPlatformType()
	{
		return 4;
	}

	public String getUserDataDirectory()
		throws PlatformManagerException
	{
		String userhome = System.getProperty("user.home");
		String temp_user_path = (new StringBuilder()).append(userhome).append(SystemProperties.SEP).append(".").append(SystemProperties.APPLICATION_NAME.toLowerCase()).append(SystemProperties.SEP).toString();
		synchronized (migrate_lock)
		{
			File home = new File(temp_user_path);
			if (!home.exists())
			{
				String old_home_path = (new StringBuilder()).append(userhome).append(SystemProperties.SEP).append(".").append(SystemProperties.APPLICATION_NAME).append(SystemProperties.SEP).toString();
				File old_home = new File(old_home_path);
				if (old_home.exists())
				{
					String msg = (new StringBuilder()).append("Migrating unix user config dir [").append(old_home_path).append("] ===> [").append(temp_user_path).append("]").toString();
					System.out.println(msg);
					Logger.log(new LogEvent(LOGID, (new StringBuilder()).append("SystemProperties::getUserPath(Unix): ").append(msg).toString()));
					try
					{
						old_home.renameTo(home);
					}
					catch (Throwable t)
					{
						t.printStackTrace();
						Logger.log(new LogEvent(LOGID, "migration rename failed:", t));
					}
				}
			}
		}
		return temp_user_path;
	}

	public String getComputerName()
	{
		String host = System.getenv("HOST");
		if (host != null && host.length() > 0)
			return host;
		else
			return null;
	}

	public String getVersion()
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public boolean hasCapability(PlatformManagerCapabilities capability)
	{
		return capabilitySet.contains(capability);
	}

	public boolean isApplicationRegistered()
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void performRecoverableFileDelete(String file_name)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void ping(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void registerApplication()
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void addListener(PlatformManagerListener platformmanagerlistener)
	{
	}

	public void removeListener(PlatformManagerListener platformmanagerlistener)
	{
	}

	public void setTCPTOSEnabled(boolean enabled)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public boolean testNativeAvailability(String name)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void traceRoute(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public File getLocation(long location_id)
		throws PlatformManagerException
	{
		switch ((int)location_id)
		{
		case 1: // '\001'
			return new File(getUserDataDirectory());

		case 3: // '\003'
			return new File(System.getProperty("user.home"));

		case 2: // '\002'
		case 4: // '\004'
		default:
			return null;
		}
	}

	public boolean isAdditionalFileTypeRegistered(String name, String type)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void registerAdditionalFileType(String name, String description, String type, String content_type)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void showFile(String file_name)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void unregisterAdditionalFileType(String name, String type)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public String getAzComputerID()
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	public void requestUserAttention(int type, Object data)
		throws PlatformManagerException
	{
		throw new PlatformManagerException("Unsupported capability called on platform manager");
	}

	static 
	{
		LOGID = LogIDs.CORE;
		initializeSingleton();
	}
}

⌨️ 快捷键说明

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