Skip to content

Commit

Permalink
Minor fixes for Checksum Checker Daily Report Emailer. Ensure it only…
Browse files Browse the repository at this point in the history
… sends an email if there's a possible issue. Also include DSpace hostname in email subject.
  • Loading branch information
tdonohue committed Jan 31, 2014
1 parent 046d96c commit b6f0d00
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ public DailyReportEmailer()
public void sendReport(File attachment, int numberOfBitstreams)
throws IOException, javax.mail.MessagingException
{
Email email = new Email();
email.setSubject("Checksum checker Report - " + numberOfBitstreams + " Bitstreams found with POSSIBLE issues");
email.setContent("report is attached ...");
email.addAttachment(attachment, "checksum_checker_report.txt");
email.addRecipient(ConfigurationManager.getProperty("mail.admin"));
email.send();
if(numberOfBitstreams > 0)
{
String hostname = ConfigurationManager.getProperty("dspace.hostname");
Email email = new Email();
email.setSubject("Checksum checker Report - " + numberOfBitstreams + " Bitstreams found with POSSIBLE issues on " + hostname);
email.setContent("report is attached ...");
email.addAttachment(attachment, "checksum_checker_report.txt");
email.addRecipient(ConfigurationManager.getProperty("mail.admin"));
email.send();
}
}

/**
Expand Down

0 comments on commit b6f0d00

Please sign in to comment.