/** * Constructs the executed command response from multiple streams of data containing the encoded result of the execution. * * @param response * @param outputStream * @return the decoded result of the command in a string. * @throws ParserConfigurationException * @throws SAXException * @throws XPathExpressionException * @throws IOException */ private String buildResultFromResponseStreams(String response, OutputStream outputStream) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { StringBuilder commandResult = new StringBuilder(); int noOfStreams = WSManUtils.countStreamElements(response); for (int streamNo = 0; streamNo < noOfStreams; streamNo++) { String stream = XMLUtils.parseXml(response, String.format(RECEIVE_RESPONSE_XPATH, outputStream.getValue(), streamNo)); if (!"DQo=".equals(stream)) { commandResult.append(EncoderDecoder.decodeBase64String(stream)); } } return commandResult.toString(); }
/** * Constructs the executed command response from multiple streams of data containing the encoded result of the execution. * * @param response * @param outputStream * @return the decoded result of the command in a string. * @throws ParserConfigurationException * @throws SAXException * @throws XPathExpressionException * @throws IOException */ private String buildResultFromResponseStreams(String response, OutputStream outputStream) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException { StringBuilder commandResult = new StringBuilder(); int noOfStreams = WSManUtils.countStreamElements(response); for (int streamNo = 0; streamNo < noOfStreams; streamNo++) { String stream = XMLUtils.parseXml(response, String.format(RECEIVE_RESPONSE_XPATH, outputStream.getValue(), streamNo)); if (!"DQo=".equals(stream)) { commandResult.append(EncoderDecoder.decodeBase64String(stream)); } } return commandResult.toString(); }