* file parent path or null
* @return a PdfFile object given a file node
* @throws Exception
*/
private PdfFile getPdfFileFromNode(Node pdfNode, String parentPath) throws Exception {
PdfFile retVal = null;
String pwd = null;
String fileName = null;
// get filename
Node fileNode = pdfNode.selectSingleNode("@value");
if (fileNode != null) {
fileName = fileNode.getText().trim();
} else {
throw new ConcatException(ConcatException.ERR_READING_CSV_OR_XML, new String[] { "Empty file name." });
}
// get pwd value
Node pwdNode = pdfNode.selectSingleNode("@password");
if (pwdNode != null) {
pwd = pwdNode.getText();
}
if (parentPath != null && parentPath.length() > 0) {
retVal = new PdfFile(new File(parentPath, fileName), pwd);
} else {
retVal = new PdfFile(fileName, pwd);
}
return retVal;
}