Skip to content

Commit

Permalink
Fix empty folder creation & bump to 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitylow committed Aug 4, 2014
1 parent eb471ba commit f1d6f5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>net.gravitydevelopment.updater</groupId>
<artifactId>updater</artifactId>
<version>2.2</version>
<version>2.3</version>
<packaging>jar</packaging>
<name>Updater</name>
<url>http://forums.bukkit.org/threads/updater-2-0-easy-safe-and-policy-compliant-auto-updating-for-your-plugins-new.96681/</url>
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/net/gravitydevelopment/updater/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -592,7 +588,7 @@ private boolean versionCheck() {
* determine whether a new update is actually an update is sometimes extremely complicated.
* </p>
* <p>
* 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
Expand Down

0 comments on commit f1d6f5c

Please sign in to comment.