If you need to Stick to a Wget
from java, you might have to the check the downloading file on disk and do your percentage from the increasing size.
reading shell script output in java (wget)
Frage
I'm trying to write a graphical interface for wget. I can run shell scripts in java and read script's output, but in case of wget the following code won't work.
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("wget someAddress");
InputStream output = proc.getInputStream();
int nextByte = output.read();
while(nextByte != -1){
System.out.print((char)nextByte);
nextByte = output.read();
}
so what should I do in order to get percenage of download?
thanks in advance
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow