Permalink
Browse files

Merge pull request #442 from tdonohue/DS-1873

DS-1873: Minor fixes for Checksum Checker Daily Report Emailer.
  • Loading branch information...
2 parents c6d8bab + a27d40c commit 8f35788a2e7026fae18aee9454c530986c053ccb @tdonohue tdonohue committed Jan 31, 2014
Showing with 10 additions and 6 deletions.
  1. +10 −6 dspace-api/src/main/java/org/dspace/checker/DailyReportEmailer.java
@@ -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();
+ }
}
/**

0 comments on commit 8f35788

Please sign in to comment.