savelocationchange.java

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

JAVA
86
字号
// 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:   SaveLocationChange.java

package org.gudy.azureus2.plugins.download.savelocation;

import java.io.File;

public class SaveLocationChange
{

	public File download_location;
	public String download_name;
	public File torrent_location;
	public String torrent_name;

	public SaveLocationChange()
	{
		download_location = null;
		download_name = null;
		torrent_location = null;
		torrent_name = null;
	}

	public final String toString()
	{
		StringBuffer res = new StringBuffer("SaveLocationChange: ");
		res.append("DL-LOC=");
		res.append(download_location);
		res.append(", DL-NAME=");
		res.append(download_name);
		res.append(", TOR-LOC=");
		res.append(torrent_location);
		res.append(", TOR-NAME=");
		res.append(torrent_name);
		return res.toString();
	}

	public final File normaliseTorrentLocation(File old_torrent_location)
	{
		return normaliseTorrentLocation(old_torrent_location.getParentFile(), old_torrent_location.getName());
	}

	public final File normaliseTorrentLocation(File old_torrent_directory, String old_torrent_name)
	{
		return new File(torrent_location == null ? old_torrent_directory : torrent_location, torrent_name == null ? old_torrent_name : torrent_name);
	}

	public final File normaliseDownloadLocation(File old_download_location)
	{
		return normaliseDownloadLocation(old_download_location.getParentFile(), old_download_location.getName());
	}

	public final File normaliseDownloadLocation(File old_download_directory, String old_download_name)
	{
		return new File(download_location == null ? old_download_directory : download_location, download_name == null ? old_download_name : download_name);
	}

	public final boolean hasDownloadChange()
	{
		return download_location != null || download_name != null;
	}

	public final boolean hasTorrentChange()
	{
		return torrent_location != null || torrent_name != null;
	}

	public final boolean isDifferentDownloadLocation(File current_location)
	{
		if (!hasDownloadChange())
			return false;
		else
			return !current_location.equals(normaliseDownloadLocation(current_location));
	}

	public final boolean isDifferentTorrentLocation(File current_location)
	{
		if (!hasTorrentChange())
			return false;
		else
			return !current_location.equals(normaliseTorrentLocation(current_location));
	}
}

⌨️ 快捷键说明

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