Many bugfixes and improvements
This commit is contained in:
parent
c3e3bbf787
commit
363e0c6cfc
52 changed files with 2021 additions and 982 deletions
|
|
@ -1,20 +1,43 @@
|
|||
package zutil.test;
|
||||
|
||||
import zutil.ProgressListener;
|
||||
import zutil.net.UpdateClient;
|
||||
import zutil.net.Zupdater;
|
||||
import java.awt.EventQueue;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class UpdateClientTest implements ProgressListener{
|
||||
import zutil.ProgressListener;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.update.FileInfo;
|
||||
import zutil.net.update.UpdateClient;
|
||||
import zutil.net.update.Zupdater;
|
||||
|
||||
public class UpdateClientTest implements ProgressListener<UpdateClient, FileInfo>{
|
||||
public static void main(String[] args){
|
||||
LogUtil.setLevel("zutil", Level.FINEST);
|
||||
LogUtil.setFormatter("zutil", new CompactLogFormatter());
|
||||
|
||||
UpdateClientTest client = new UpdateClientTest();
|
||||
client.start();
|
||||
}
|
||||
|
||||
public void start(){
|
||||
try {
|
||||
UpdateClient client = new UpdateClient("localhost", 2000, "client");
|
||||
final UpdateClient client = new UpdateClient("localhost", 2000, "C:\\Users\\Ziver\\Desktop\\client");
|
||||
client.setProgressListener(new Zupdater());
|
||||
|
||||
//client.setProgressListener(this);
|
||||
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
Zupdater gui = new Zupdater();
|
||||
client.setProgressListener(gui);
|
||||
gui.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
client.update();
|
||||
client.close();
|
||||
} catch (Exception e) {
|
||||
|
|
@ -22,7 +45,7 @@ public class UpdateClientTest implements ProgressListener{
|
|||
}
|
||||
}
|
||||
|
||||
public void progressUpdate(Object source, Object info, double percent) {
|
||||
public void progressUpdate(UpdateClient source, FileInfo info, double percent) {
|
||||
System.out.println(info+": "+percent+"%");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue