Fix FileUtils being referenced when it's not compatible with 1.12 and other alternatives exist
This commit is contained in:
parent
301617c0f3
commit
669dbbeb78
@ -27,7 +27,6 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.craftbukkit.libs.org.apache.commons.io.FileUtils;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
@ -528,8 +527,7 @@ public class DisguiseConfig {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (config.exists()) {
|
if (config.exists()) {
|
||||||
FileUtils.copyFile(config, new File(config.getParentFile(), "config-old.yml"));
|
config.renameTo(new File(config.getParentFile(), "config-old.yml"));
|
||||||
config.delete();
|
|
||||||
|
|
||||||
DisguiseUtilities.getLogger().info("Old config has been copied to config-old.yml");
|
DisguiseUtilities.getLogger().info("Old config has been copied to config-old.yml");
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import me.libraryaddict.disguise.utilities.plugin.PluginInformation;
|
|||||||
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
|
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.craftbukkit.libs.org.apache.commons.io.FileUtils;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@ -19,6 +18,8 @@ import java.io.InputStreamReader;
|
|||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
@ -232,7 +233,7 @@ public class UpdateChecker {
|
|||||||
|
|
||||||
// Get the input stream, what we receive
|
// Get the input stream, what we receive
|
||||||
try (InputStream input = con.getInputStream()) {
|
try (InputStream input = con.getInputStream()) {
|
||||||
FileUtils.copyInputStreamToFile(input, dest);
|
Files.copy(input, dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisguiseUtilities.getLogger().info("Download success!");
|
DisguiseUtilities.getLogger().info("Download success!");
|
||||||
|
Loading…
Reference in New Issue
Block a user