Clean up code & Upgrade syntax to new Java
This commit is contained in:
@@ -4,8 +4,9 @@ import com.esotericsoftware.yamlbeans.YamlReader;
|
||||
import constants.string.CharsetConstants;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -18,7 +19,7 @@ public class YamlConfig {
|
||||
|
||||
private static YamlConfig loadConfig() {
|
||||
try {
|
||||
YamlReader reader = new YamlReader(new FileReader(CONFIG_FILE_NAME, CharsetConstants.CHARSET));
|
||||
YamlReader reader = new YamlReader(Files.newBufferedReader(Paths.get(CONFIG_FILE_NAME), CharsetConstants.CHARSET));
|
||||
YamlConfig config = reader.read(YamlConfig.class);
|
||||
reader.close();
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user