pathNode, XPathConstants.NODE);
final String command = commandNode.getTextContent().trim();
if (command.length() == 0) {
throw new MigrationPathConfigException(
"No command was specified in the '"
+ commandLineElementName + "' element in the '"
+ pathNode.getNodeName() + "' element.");
}
final NodeList parameterNodes = (NodeList) pathsXPath
.evaluate(
commandLineElementName
+ "/"
+ ConfigurationFileTagsV1.COMMANDPARAMETER_ELEMENT_XPATH,
pathNode, XPathConstants.NODESET);
final ArrayList<String> commandLineParameters = new ArrayList<String>();
for (int parameterIndex = 0; parameterIndex < parameterNodes
.getLength(); parameterIndex++) {
final Node parameterNode = parameterNodes.item(parameterIndex);
commandLineParameters
.add(parameterNode.getTextContent().trim());
}
return new CommandLine(command, commandLineParameters);
} catch (XPathExpressionException xpee) {
throw new MigrationPathConfigException(
"Failed reading command and parameters from the '"
+ commandLineElementName + "' element in the '"
+ pathNode.getNodeName() + "' element.", xpee);
}
}