Delete updater jar file if already exists
This commit is contained in:
parent
7d6d360908
commit
69a0918a77
1 changed files with 1 additions and 0 deletions
|
|
@ -182,6 +182,7 @@ public class UpdateCheckerTask implements Runnable {
|
||||||
private File saveUpdater() {
|
private File saveUpdater() {
|
||||||
InputStream in = getClass().getClassLoader().getResourceAsStream(UPDATER_FILE_NAME);
|
InputStream in = getClass().getClassLoader().getResourceAsStream(UPDATER_FILE_NAME);
|
||||||
File file = new File(plugin.getDataFolder().getParent(), UPDATER_FILE_NAME);
|
File file = new File(plugin.getDataFolder().getParent(), UPDATER_FILE_NAME);
|
||||||
|
if (file.exists()) file.delete();
|
||||||
try {
|
try {
|
||||||
FileUtils.saveResource(in, file);
|
FileUtils.saveResource(in, file);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue