Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/**************************************
*
* WatchDog for MK-Connection
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*
**************************************/
public class FirmwareLoader
implements Runnable
{
public final static String base_url=
"http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/firmwares/";
boolean got_list=
false;
String list_str=
"";
String[] names
;
String[] filenames
;
public FirmwareLoader
()
{
new Thread( this ).
start(); // fire up main Thread
}
public void run
()
{
if (!got_list
)
{
list_str=DUBwiseHelper.
get_http_string(base_url+
"list");
String[] split=DUBwiseHelper.
split_str(list_str,
"\n");
names=
new String[ split.
length];
filenames=
new String[ split.
length];
for ( int i=
0;i
<split.
length;i++
)
{
String[] sp2=DUBwiseHelper.
split_str(split
[i
],
":");
if (sp2.
length==
2)
{
names
[i
]=sp2
[0];
filenames
[i
]=sp2
[1];
}
else
names
[i
]=
"fail";
}
System.
out.
println(list_str
);
got_list=
true;
}
else
{
}
}
}