문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top