mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixes in updater
This commit is contained in:
parent
0bb018cdbd
commit
f3ca652a0c
2 changed files with 19 additions and 2 deletions
|
@ -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>
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue