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

📄 updateimpl.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:   UpdateImpl.java

package org.gudy.azureus2.pluginsimpl.local.update;

import com.aelitis.azureus.core.util.CopyOnWriteList;
import java.io.InputStream;
import java.util.Iterator;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.update.*;
import org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloader;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.update:
//			UpdateCheckInstanceImpl, UpdateManagerImpl

public class UpdateImpl
	implements Update
{

	private UpdateCheckInstanceImpl instance;
	private String name;
	private String description[];
	private String relative_url_base;
	private String new_version;
	private ResourceDownloader downloaders[];
	private boolean mandatory;
	private int restart_required;
	private String description_url;
	private Object user_object;
	private CopyOnWriteList listeners;
	private volatile boolean cancelled;
	private volatile boolean complete;

	protected UpdateImpl(UpdateCheckInstanceImpl _instance, String _name, String _desc[], String _new_version, ResourceDownloader _downloaders[], boolean _mandatory, int _restart_required)
	{
		relative_url_base = "";
		listeners = new CopyOnWriteList();
		instance = _instance;
		name = _name;
		description = _desc;
		new_version = _new_version;
		downloaders = _downloaders;
		mandatory = _mandatory;
		restart_required = _restart_required;
	}

	public UpdateCheckInstance getCheckInstance()
	{
		return instance;
	}

	public String getName()
	{
		return name;
	}

	public String[] getDescription()
	{
		return description;
	}

	public String getRelativeURLBase()
	{
		return relative_url_base;
	}

	public void setRelativeURLBase(String base)
	{
		relative_url_base = base;
	}

	public String getDesciptionURL()
	{
		return description_url;
	}

	public void setDescriptionURL(String url)
	{
		description_url = url;
	}

	public String getNewVersion()
	{
		return new_version;
	}

	public ResourceDownloader[] getDownloaders()
	{
		return downloaders;
	}

	public boolean isMandatory()
	{
		return mandatory;
	}

	public void setRestartRequired(int _restart_required)
	{
		restart_required = _restart_required;
	}

	public int getRestartRequired()
	{
		return restart_required;
	}

	public void setUserObject(Object obj)
	{
		user_object = obj;
	}

	public Object getUserObject()
	{
		return user_object;
	}

	public void cancel()
	{
		cancelled = true;
		for (int i = 0; i < downloaders.length; i++)
			try
			{
				downloaders[i].cancel();
			}
			catch (Throwable e)
			{
				Debug.printStackTrace(e);
			}

		for (Iterator it = listeners.iterator(); it.hasNext();)
			try
			{
				((UpdateListener)it.next()).cancelled(this);
			}
			catch (Throwable e)
			{
				Debug.printStackTrace(e);
			}

	}

	public void complete()
	{
		complete = true;
		Iterator it = listeners.iterator();
		for (int i = 0; i < listeners.size(); i++)
			try
			{
				((UpdateListener)it.next()).complete(this);
			}
			catch (Throwable e)
			{
				Debug.printStackTrace(e);
			}

	}

	public boolean isCancelled()
	{
		return cancelled;
	}

	public boolean isComplete()
	{
		return complete;
	}

	public Object getDecision(int decision_type, String decision_name, String decision_description, Object decision_data)
	{
		return instance.getDecision(this, decision_type, decision_name, decision_description, decision_data);
	}

	public InputStream verifyData(InputStream is, boolean force)
		throws UpdateException
	{
		return ((UpdateManagerImpl)instance.getManager()).verifyData(this, is, force);
	}

	public void addListener(UpdateListener l)
	{
		listeners.add(l);
		if (cancelled)
			l.cancelled(this);
		else
		if (complete)
			l.complete(this);
	}

	public void removeListener(UpdateListener l)
	{
		listeners.remove(l);
	}
}

⌨️ 快捷键说明

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