String outputFile = fileElement.getAttribute(REGEX_ATTR);
if (outputFile.equals("")){
outputFile = fillIn(fileElement.getAttribute(NAME_ATTR),
metadata);
}
PathUtilsNamingConvention renamingConvention = null;
NodeList renamingConvNodes = fileElement
.getElementsByTagName(RENAMING_CONV_TAG);
if (renamingConvNodes.getLength() > 0) {
Element renamingElement = (Element) renamingConvNodes.item(0);
String namingExpr = renamingElement
.getAttribute(NAMING_EXPR_ATTR);
if (renamingElement.getAttribute(ENV_REPLACE_ATTR)
.toLowerCase().equals("true")){
namingExpr = fillIn(namingExpr, metadata, false);
}
else if (!renamingElement.getAttribute(ENV_REPLACE_ATTR)
.toLowerCase().equals("false")){
namingExpr = fillIn(namingExpr, metadata);
}
renamingConvention = new PathUtilsNamingConvention();
renamingConvention.setNamingConv(namingExpr);
NodeList metadataNodes = renamingElement
.getElementsByTagName(METADATA_TAG);
for (int k = 0; k < metadataNodes.getLength(); k++) {
renamingConvention.addTmpReplaceMet(((Element) metadataNodes
.item(k)).getAttribute(KEY_ATTR), Arrays
.asList(((Element) metadataNodes.item(k))
.getAttribute(VAL_ATTR).split(",")));
}
}