refactor: use dedicated method
This commit is contained in:
parent
4c5ff34a8d
commit
fca460df50
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import de.studiocode.invui.util.IOUtils;
|
|||
import net.artelnatif.nicko.NickoBukkit;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
|
||||
public class LocaleFileManager {
|
||||
private final File folder = new File(NickoBukkit.getInstance().getDataFolder() + "/lang/");
|
||||
|
@ -12,7 +13,7 @@ public class LocaleFileManager {
|
|||
|
||||
public String get(String key) {
|
||||
if (!file.exists()) return key;
|
||||
try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
|
||||
try (BufferedInputStream inputStream = new BufferedInputStream(Files.newInputStream(file.toPath()))) {
|
||||
final YamlConfig yamlConfig = YamlConfig.load(inputStream);
|
||||
return yamlConfig.getString(key);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in a new issue