rpshortcuts.java

来自「java 文件下载器。可自定义」· Java 代码 · 共 199 行

JAVA
199
字号
// 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:   RPShortCuts.java

package org.gudy.azureus2.pluginsimpl.remote.utils;

import org.gudy.azureus2.plugins.download.*;
import org.gudy.azureus2.plugins.utils.ShortCuts;
import org.gudy.azureus2.pluginsimpl.remote.*;
import org.gudy.azureus2.pluginsimpl.remote.download.RPDownload;
import org.gudy.azureus2.pluginsimpl.remote.download.RPDownloadStats;

public class RPShortCuts extends RPObject
	implements ShortCuts
{

	protected transient ShortCuts delegate;

	public static RPShortCuts create(ShortCuts _delegate)
	{
		RPShortCuts res = (RPShortCuts)_lookupLocal(_delegate);
		if (res == null)
			res = new RPShortCuts(_delegate);
		return res;
	}

	protected RPShortCuts(ShortCuts _delegate)
	{
		super(_delegate);
	}

	protected void _setDelegate(Object _delegate)
	{
		delegate = (ShortCuts)_delegate;
	}

	public Object _setLocal()
		throws RPException
	{
		Object res = _fixupLocal();
		return res;
	}

	public void _setRemote(RPRequestDispatcher _dispatcher)
	{
		super._setRemote(_dispatcher);
	}

	public RPReply _process(RPRequest request)
	{
		String method;
		Object params[];
		method = request.getMethod();
		params = request.getParams();
		if (!method.equals("getDownload[byte[]]"))
			break MISSING_BLOCK_LABEL_60;
		return new RPReply(RPDownload.create(delegate.getDownload((byte[])(byte[])params[0])));
		DownloadException e;
		e;
		return new RPReply(e);
		if (!method.equals("getDownloadStats[byte[]]"))
			break MISSING_BLOCK_LABEL_110;
		return new RPReply(RPDownloadStats.create(delegate.getDownloadStats((byte[])(byte[])params[0])));
		e;
		return new RPReply(e);
		if (method.equals("restartDownload[byte[]]"))
		{
			try
			{
				delegate.restartDownload((byte[])(byte[])params[0]);
			}
			// Misplaced declaration of an exception variable
			catch (DownloadException e)
			{
				return new RPReply(e);
			}
			return null;
		}
		if (method.equals("stopDownload[byte[]]"))
		{
			try
			{
				delegate.stopDownload((byte[])(byte[])params[0]);
			}
			// Misplaced declaration of an exception variable
			catch (DownloadException e)
			{
				return new RPReply(e);
			}
			return null;
		}
		if (method.equals("removeDownload[byte[]]"))
		{
			try
			{
				delegate.removeDownload((byte[])(byte[])params[0]);
			}
			// Misplaced declaration of an exception variable
			catch (DownloadException e)
			{
				return new RPReply(e);
			}
			return null;
		} else
		{
			throw new RPException((new StringBuilder()).append("Unknown method: ").append(method).toString());
		}
	}

	public Download getDownload(byte hash[])
		throws DownloadException
	{
		RPDownload res;
		res = (RPDownload)_dispatcher.dispatch(new RPRequest(this, "getDownload[byte[]]", new Object[] {
			hash
		})).getResponse();
		res._setRemote(_dispatcher);
		return res;
		RPException e;
		e;
		if (e.getCause() instanceof DownloadException)
			throw (DownloadException)e.getCause();
		else
			throw e;
	}

	public DownloadStats getDownloadStats(byte hash[])
		throws DownloadException
	{
		RPDownloadStats res;
		res = (RPDownloadStats)_dispatcher.dispatch(new RPRequest(this, "getDownloadStats[byte[]]", new Object[] {
			hash
		})).getResponse();
		res._setRemote(_dispatcher);
		return res;
		RPException e;
		e;
		if (e.getCause() instanceof DownloadException)
			throw (DownloadException)e.getCause();
		else
			throw e;
	}

	public void restartDownload(byte hash[])
		throws DownloadException
	{
		try
		{
			_dispatcher.dispatch(new RPRequest(this, "restartDownload[byte[]]", new Object[] {
				hash
			})).getResponse();
		}
		catch (RPException e)
		{
			if (e.getCause() instanceof DownloadException)
				throw (DownloadException)e.getCause();
			else
				throw e;
		}
	}

	public void stopDownload(byte hash[])
		throws DownloadException
	{
		try
		{
			_dispatcher.dispatch(new RPRequest(this, "stopDownload[byte[]]", new Object[] {
				hash
			})).getResponse();
		}
		catch (RPException e)
		{
			if (e.getCause() instanceof DownloadException)
				throw (DownloadException)e.getCause();
			else
				throw e;
		}
	}

	public void removeDownload(byte hash[])
		throws DownloadException
	{
		try
		{
			_dispatcher.dispatch(new RPRequest(this, "removeDownload[byte[]]", new Object[] {
				hash
			})).getResponse();
		}
		catch (RPException e)
		{
			if (e.getCause() instanceof DownloadException)
				throw (DownloadException)e.getCause();
			else
				throw e;
		}
	}
}

⌨️ 快捷键说明

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