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

📄 shareutils.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:   ShareUtils.java

package org.gudy.azureus2.ui.swt.sharing;

import com.aelitis.azureus.core.AzureusCore;
import java.io.File;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.PluginInterface;
import org.gudy.azureus2.plugins.PluginManager;
import org.gudy.azureus2.plugins.sharing.ShareManager;
import org.gudy.azureus2.ui.swt.mainwindow.TorrentOpener;

public class ShareUtils
{

	public ShareUtils()
	{
	}

	public static void shareFile(AzureusCore azureus_core, Shell shell)
	{
		(new AEThread("shareFile", shell, azureus_core) {

			final Shell val$shell;
			final AzureusCore val$azureus_core;

			public void runSupport()
			{
				Display display = shell.getDisplay();
				final String path[] = {
					null
				};
				final AESemaphore sem = new AESemaphore("ShareUtils:file");
				display.asyncExec(new AERunnable() {

					final String val$path[];
					final AESemaphore val$sem;
					final 1 this$0;

					public void runSupport()
					{
						FileDialog dialog = new FileDialog(shell, 0x21000);
						dialog.setFilterPath(TorrentOpener.getFilterPathData());
						dialog.setText(MessageText.getString("MainWindow.dialog.share.sharefile"));
						path[0] = TorrentOpener.setFilterPathData(dialog.open());
						sem.release();
						break MISSING_BLOCK_LABEL_66;
						Exception exception;
						exception;
						sem.release();
						throw exception;
					}

					
					{
						this$0 = 1.this;
						path = as;
						sem = aesemaphore;
						super();
					}
				});
				sem.reserve();
				if (path[0] != null)
					ShareUtils.shareFile(azureus_core, path[0]);
			}

			
			{
				shell = shell1;
				azureus_core = azureuscore;
				super(x0);
			}
		}).start();
	}

	public static void shareDir(AzureusCore azureus_core, Shell shell)
	{
		shareDirSupport(azureus_core, shell, false, false);
	}

	public static void shareDirContents(AzureusCore azureus_core, Shell shell, boolean recursive)
	{
		shareDirSupport(azureus_core, shell, true, recursive);
	}

	protected static void shareDirSupport(AzureusCore azureus_core, Shell shell, boolean contents, boolean recursive)
	{
		(new AEThread("shareDirSupport", shell, contents, recursive, azureus_core) {

			final Shell val$shell;
			final boolean val$contents;
			final boolean val$recursive;
			final AzureusCore val$azureus_core;

			public void runSupport()
			{
				Display display = shell.getDisplay();
				final String path[] = {
					null
				};
				final AESemaphore sem = new AESemaphore("ShareUtils:dir");
				display.asyncExec(new AERunnable() {

					final String val$path[];
					final AESemaphore val$sem;
					final 2 this$0;

					public void runSupport()
					{
						DirectoryDialog dialog = new DirectoryDialog(shell, 0x20000);
						dialog.setFilterPath(TorrentOpener.getFilterPathData());
						dialog.setText(contents ? (new StringBuilder()).append(MessageText.getString("MainWindow.dialog.share.sharedircontents")).append(recursive ? (new StringBuilder()).append("(").append(MessageText.getString("MainWindow.dialog.share.sharedircontents.recursive")).append(")").toString() : "").toString() : MessageText.getString("MainWindow.dialog.share.sharedir"));
						path[0] = TorrentOpener.setFilterPathData(dialog.open());
						sem.release();
						break MISSING_BLOCK_LABEL_143;
						Exception exception;
						exception;
						sem.release();
						throw exception;
					}

					
					{
						this$0 = 2.this;
						path = as;
						sem = aesemaphore;
						super();
					}
				});
				sem.reserve();
				if (path[0] != null)
					if (contents)
						ShareUtils.shareDirContents(azureus_core, path[0], recursive);
					else
						ShareUtils.shareDir(azureus_core, path[0]);
			}

			
			{
				shell = shell1;
				contents = flag;
				recursive = flag1;
				azureus_core = azureuscore;
				super(x0);
			}
		}).start();
	}

	public static void shareFile(AzureusCore azureus_core, String file_name)
	{
		(new AEThread("shareFile", azureus_core, file_name) {

			final AzureusCore val$azureus_core;
			final String val$file_name;

			public void runSupport()
			{
				try
				{
					azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addFile(new File(file_name));
				}
				catch (Throwable e)
				{
					Debug.printStackTrace(e);
				}
			}

			
			{
				azureus_core = azureuscore;
				file_name = s;
				super(x0);
			}
		}).start();
	}

	public static void shareDir(AzureusCore azureus_core, String file_name)
	{
		(new AEThread("shareDir", azureus_core, file_name) {

			final AzureusCore val$azureus_core;
			final String val$file_name;

			public void runSupport()
			{
				try
				{
					azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addDir(new File(file_name));
				}
				catch (Throwable e)
				{
					Debug.printStackTrace(e);
				}
			}

			
			{
				azureus_core = azureuscore;
				file_name = s;
				super(x0);
			}
		}).start();
	}

	public static void shareDirContents(AzureusCore azureus_core, String file_name, boolean recursive)
	{
		(new AEThread("shareDirCntents", azureus_core, file_name, recursive) {

			final AzureusCore val$azureus_core;
			final String val$file_name;
			final boolean val$recursive;

			public void runSupport()
			{
				try
				{
					azureus_core.getPluginManager().getDefaultPluginInterface().getShareManager().addDirContents(new File(file_name), recursive);
				}
				catch (Throwable e)
				{
					Debug.printStackTrace(e);
				}
			}

			
			{
				azureus_core = azureuscore;
				file_name = s;
				recursive = flag;
				super(x0);
			}
		}).start();
	}
}

⌨️ 快捷键说明

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