mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-21 16:19:13 +01:00
Use Bukkit API to extract "email.html" from plugin file.
This commit is contained in:
parent
071800481a
commit
266c979319
@ -310,8 +310,9 @@ public final class Settings {
|
||||
}
|
||||
|
||||
private static String loadEmailText() {
|
||||
if (!EMAIL_FILE.exists())
|
||||
saveDefaultEmailText();
|
||||
if (!EMAIL_FILE.exists()) {
|
||||
plugin.saveResource("email.html", false);
|
||||
}
|
||||
StringBuilder str = new StringBuilder();
|
||||
try {
|
||||
BufferedReader in = new BufferedReader(new FileReader(EMAIL_FILE));
|
||||
@ -324,21 +325,6 @@ public final class Settings {
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
private static void saveDefaultEmailText() {
|
||||
InputStream file = plugin.getResource("email.html");
|
||||
StringBuilder str = new StringBuilder();
|
||||
try {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(file, Charset.forName("utf-8")));
|
||||
String s;
|
||||
while ((s = in.readLine()) != null)
|
||||
str.append(s);
|
||||
in.close();
|
||||
Files.touch(EMAIL_FILE);
|
||||
Files.write(str.toString(), EMAIL_FILE, Charsets.UTF_8);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param key the key to set
|
||||
|
Loading…
Reference in New Issue
Block a user