From 9752ff311e4953b463c11885a041fe85366a2ce5 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 18 Aug 2016 14:42:38 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20mineure=20de=20la=20gestion?= =?UTF-8?q?=20des=20fichiers=20de=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/util/config/AbstractConfig.java | 15 ++++++++++++++- .../java/util/config/AbstractConfigManager.java | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/fr/pandacube/java/util/config/AbstractConfig.java b/src/fr/pandacube/java/util/config/AbstractConfig.java index 4684cd9..b6c4709 100644 --- a/src/fr/pandacube/java/util/config/AbstractConfig.java +++ b/src/fr/pandacube/java/util/config/AbstractConfig.java @@ -6,9 +6,11 @@ import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import fr.pandacube.java.util.Log; +import net.md_5.bungee.api.ChatColor; /** * Classe chargeant en mémoire un fichier de configuration ou un dossier donné * @author Marc Baloup @@ -110,13 +112,24 @@ public abstract class AbstractConfig { if (perms == null || perms.equals("*")) return null; else - return Arrays.asList(perms.split(";")); + return getSplittedString(perms, ";"); } + public static List getSplittedString(String value, String split) { + return Collections.unmodifiableList(Arrays.asList(value.split(split))); + } + + + + public static String getTranslatedColorCode(String string) { + return ChatColor.translateAlternateColorCodes('&', string); + } + + protected void warning(String message) { diff --git a/src/fr/pandacube/java/util/config/AbstractConfigManager.java b/src/fr/pandacube/java/util/config/AbstractConfigManager.java index 7713301..aa03a8a 100644 --- a/src/fr/pandacube/java/util/config/AbstractConfigManager.java +++ b/src/fr/pandacube/java/util/config/AbstractConfigManager.java @@ -5,7 +5,7 @@ import java.io.IOException; public abstract class AbstractConfigManager { - protected File configDir; + protected final File configDir; public AbstractConfigManager(File configD) throws IOException { configDir = configD;