fixes in updater

This commit is contained in:
Loki 2012-05-07 00:17:58 +03:00
parent 0bb018cdbd
commit f3ca652a0c
2 changed files with 19 additions and 2 deletions

View file

@ -12,5 +12,19 @@
<name>Mage Client Updater</name>
<artifactId>mage-updater-client</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.magefree.update.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -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;