/**
* Perform the log transform and publish the results.
*/
public void publish(Element cruisecontrolLog) throws CruiseControlException {
XMLLogHelper helper = new XMLLogHelper(cruisecontrolLog);
Boolean buildSuccess = null;
try {
buildSuccess = new Boolean(helper.isBuildSuccessful());
} catch (NullPointerException ne) {
//Do Nothing - leave buildSuccess = null
}
//if the cruisecontrollog element or the buildSuccess attribute
//turn out to be null, then there is nothing to do, so just return
if (cruisecontrolLog == null || buildSuccess == null) {
return;
}
//if the build failed and we are not supposed to publish on fail the return immediately
if (!buildSuccess.booleanValue() && !publishOnFail) {
LOG.info("Build failed and publishOnFail is false: Not publishing log.");
return;
}
//If the outFileName attribute is null then construct the outFileName based
//upon the build label that was created
if (outFileName == null) {
String label = helper.getCruiseControlInfoProperty("label");
if (label == null || label.trim().length() == 0) {
throw new CruiseControlException("The Label property is not set in the log file..."
+ "unable to publish the log.");
}
LOG.debug(