From f3ca652a0c48b9bc8ae1c7100dd10485efbdce00 Mon Sep 17 00:00:00 2001 From: Loki Date: Mon, 7 May 2012 00:17:58 +0300 Subject: [PATCH] fixes in updater --- mage.updater.client/pom.xml | 16 +++++++++++++++- .../src/main/java/com/magefree/update/Main.java | 5 ++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mage.updater.client/pom.xml b/mage.updater.client/pom.xml index c4cd02eba4..e51ba18019 100644 --- a/mage.updater.client/pom.xml +++ b/mage.updater.client/pom.xml @@ -12,5 +12,19 @@ Mage Client Updater mage-updater-client - + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.magefree.update.Main + + + + + + \ No newline at end of file diff --git a/mage.updater.client/src/main/java/com/magefree/update/Main.java b/mage.updater.client/src/main/java/com/magefree/update/Main.java index aa7779c915..13dd024be7 100644 --- a/mage.updater.client/src/main/java/com/magefree/update/Main.java +++ b/mage.updater.client/src/main/java/com/magefree/update/Main.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Scanner; public class Main { - private final static String URL_PREFIX = "http://magefree.com:81/test1/update/"; + private final static String URL_PREFIX = "http://download.magefree.com/update/"; public static void main(String[] args) throws Exception { Main m = new Main(); @@ -117,6 +117,9 @@ public class Main { System.out.println("downloading " + filename); try { InputStream in = urlConnection.getInputStream(); + File f = new File(filename); + if (!f.exists()) + f.getParentFile().mkdirs(); FileOutputStream out = new FileOutputStream(filename); byte[] buf = new byte[4 * 1024]; int bytesRead;