mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-09 17:27:38 +00:00
use try-with-resources
This commit is contained in:
parent
bd692917e6
commit
39e1026400
@ -439,9 +439,10 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
|||||||
File actual = new File(getDataFolder(), name);
|
File actual = new File(getDataFolder(), name);
|
||||||
if (!actual.exists()) {
|
if (!actual.exists()) {
|
||||||
try {
|
try {
|
||||||
InputStream stream = getResource("defaults/" + name);
|
try (InputStream stream = getResource("defaults/" + name)) {
|
||||||
if (stream == null) throw new FileNotFoundException();
|
if (stream == null) throw new FileNotFoundException();
|
||||||
copyDefaultConfig(stream, actual, name);
|
copyDefaultConfig(stream, actual, name);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().severe("Unable to read default configuration: " + name);
|
getLogger().severe("Unable to read default configuration: " + name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user