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

📄 aetemporaryfilehandler.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:   AETemporaryFileHandler.java

package org.gudy.azureus2.core3.util;

import java.io.File;
import java.io.IOException;

// Referenced classes of package org.gudy.azureus2.core3.util:
//			Debug, FileUtil

public class AETemporaryFileHandler
{

	private static final String PREFIX = "AZU";
	private static final String SUFFIX = ".tmp";
	private static boolean started_up;
	private static File tmp_dir;

	public AETemporaryFileHandler()
	{
	}

	public static synchronized void startup()
	{
		if (started_up)
			return;
		started_up = true;
		try
		{
			tmp_dir = FileUtil.getUserFile("tmp");
			if (tmp_dir.exists())
			{
				File files[] = tmp_dir.listFiles();
				if (files != null)
				{
					for (int i = 0; i < files.length; i++)
					{
						File file = files[i];
						if (file.getName().startsWith("AZU") && file.getName().endsWith(".tmp"))
							if (file.isDirectory())
								FileUtil.recursiveDelete(file);
							else
								file.delete();
					}

				}
			} else
			{
				tmp_dir.mkdir();
			}
		}
		catch (Throwable e)
		{
			try
			{
				tmp_dir = File.createTempFile("AZU", ".tmp").getParentFile();
			}
			catch (Throwable f)
			{
				tmp_dir = new File("");
			}
			if (!(e instanceof NoClassDefFoundError))
				Debug.printStackTrace(e);
		}
	}

	public static File createTempFile()
		throws IOException
	{
		startup();
		return File.createTempFile("AZU", ".tmp", tmp_dir);
	}

	public static File createTempDir()
		throws IOException
	{
		startup();
		for (int i = 0; i < 16; i++)
		{
			File f = File.createTempFile("AZU", ".tmp", tmp_dir);
			f.delete();
			if (f.mkdirs())
				return f;
		}

		throw new IOException((new StringBuilder()).append("Failed to create temporary directory in ").append(tmp_dir).toString());
	}
}

⌨️ 快捷键说明

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