Amélioration mineure de la gestion des fichiers de configuration
This commit is contained in:
parent
df696d99a3
commit
9752ff311e
@ -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<String> 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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user