From f1d6f5c41d2c1ef081ef10b248bb647c82fb3d97 Mon Sep 17 00:00:00 2001
From: gravitylow
Date: Mon, 4 Aug 2014 14:42:43 -0400
Subject: [PATCH] Fix empty folder creation & bump to 2.3
---
pom.xml | 2 +-
.../java/net/gravitydevelopment/updater/Updater.java | 10 +++-------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index 37bdf8f..b088ea6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
net.gravitydevelopment.updater
updater
- 2.2
+ 2.3
jar
Updater
http://forums.bukkit.org/threads/updater-2-0-easy-safe-and-policy-compliant-auto-updating-for-your-plugins-new.96681/
diff --git a/src/main/java/net/gravitydevelopment/updater/Updater.java b/src/main/java/net/gravitydevelopment/updater/Updater.java
index 9800365..3659678 100644
--- a/src/main/java/net/gravitydevelopment/updater/Updater.java
+++ b/src/main/java/net/gravitydevelopment/updater/Updater.java
@@ -30,7 +30,7 @@
* If you are unsure about these rules, please read the plugin submission guidelines: http://goo.gl/8iU5l
*
* @author Gravity
- * @version 2.2
+ * @version 2.3
*/
public class Updater {
@@ -242,7 +242,7 @@ public Updater(Plugin plugin, int id, File file, UpdateType type, UpdateCallback
boolean createFile = !updaterConfigFile.exists();
try {
if (createFile) {
- this.fileIOOrError(updaterConfigFile, updaterConfigFile.mkdir(), true);
+ this.fileIOOrError(updaterConfigFile, updaterConfigFile.createNewFile(), true);
config.options().copyDefaults(true);
config.save(updaterConfigFile);
} else {
@@ -361,9 +361,7 @@ private void waitForThread() {
/**
* Save an update from dev.bukkit.org into the server's update folder.
*
- * @param folder the updates folder location.
* @param file the name of the file to save it as.
- * @param link the url of the file.
*/
private void saveFile(String file) {
final File folder = this.updateFolder;
@@ -387,8 +385,6 @@ private void saveFile(String file) {
/**
* Download a file and save it to the specified folder.
- * @param link link to file.
- * @param folder folder to save file to.
*/
private void downloadFile() {
BufferedInputStream in = null;
@@ -592,7 +588,7 @@ private boolean versionCheck() {
* determine whether a new update is actually an update is sometimes extremely complicated.
*
*
- * Updater will call this method from {@link #versionCheck(String)} before deciding whether
+ * Updater will call this method from {@link #versionCheck()} before deciding whether
* the remote version is actually an update.
* If you have a specific versioning scheme with which a mathematical determination can
* be reliably made to decide whether one version is higher than another, you may