commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nie fei <teclu...@gmail.com>
Subject Why execute a ping unavailable address will raise exception?
Date Wed, 07 Nov 2012 07:17:50 GMT
Hi all,

I'm a new learner for this API.

CommandLine cmdLine = CommandLine.parse("ping 10.80.41.171 -n 1");

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        DefaultExecutor exec = new DefaultExecutor();
        PumpStreamHandler streamHandler = new
PumpStreamHandler(outputStream);
        exec.setStreamHandler(streamHandler);
        exec.execute(cmdLine);
        System.out.println(outputStream.toString());

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message