feat: 修改中断测试文件地址

Signed-off-by: 502647092 <admin@yumc.pw>
master
502647092 2017-01-20 10:31:06 +08:00
parent 3447d2457b
commit 1cb1d87b90
1 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,14 @@
package pw.yumc.BukkitInjectedTools; package pw.yumc.BukkitInjectedTools;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import pw.yumc.BukkitInjectedTools.event.YumTestEvent; import pw.yumc.BukkitInjectedTools.event.YumTestEvent;
import pw.yumc.YumCore.bukkit.Log; import pw.yumc.YumCore.bukkit.Log;
import pw.yumc.YumCore.bukkit.P; import pw.yumc.YumCore.bukkit.P;
@ -13,11 +19,6 @@ import pw.yumc.YumCore.commands.annotation.Sort;
import pw.yumc.YumCore.commands.interfaces.Executor; import pw.yumc.YumCore.commands.interfaces.Executor;
import pw.yumc.YumCore.kit.PKit; import pw.yumc.YumCore.kit.PKit;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
/** /**
* Yum * Yum
* *
@ -118,18 +119,18 @@ public class YumTestCommand implements Executor {
return; return;
} }
nfn = "null" + (size != null ? "-" + size : ""); nfn = "null" + (size != null ? "-" + size : "");
Log.sender(sender, "§c主线程中断测试!"); Log.sender(sender, "§c主线程中断测试开始!");
PKit.scheduleTask(new Runnable() { PKit.scheduleTask(new Runnable() {
@Override @Override
public void run() { public void run() {
downloading = true; downloading = true;
try { try {
final File nFile = new File(getDataFolder(), "null"); final File nFile = new File(getDataFolder(), "null");
Files.copy(new URL("http://pan.yumc.pw/" + nfn).openStream(), nFile.toPath()); Files.copy(new URL("https://coding.net/u/502647092/p/YumData/git/raw/master/dd/" + nfn).openStream(), nFile.toPath());
nFile.delete(); nFile.delete();
Log.sender(sender, "§a主线程中断测试结束!"); Log.sender(sender, "§a主线程中断测试结束!");
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); Log.sender(sender, "§a主线程中断测试失败 错误: " + e.getMessage());
} }
downloading = false; downloading = false;
} }