Skip to content
Snippets Groups Projects
Commit 273bce19 authored by brinn's avatar brinn
Browse files

change: add notification log message when a directory becomes available again

SVN: 2014
parent b4955a67
No related branches found
No related tags found
No related merge requests found
......@@ -154,10 +154,17 @@ public final class DirectoryScanningTimerTask extends TimerTask implements ISelf
private File[] listFiles()
{
boolean logErrors = (errorReadingDirectory == false);
final boolean logErrors = (errorReadingDirectory == false);
final ISimpleLogger errorLogger = logErrors ? createSimpleErrorLogger() : null;
final File[] paths = FileUtilities.tryListFiles(sourceDirectory, filter, errorLogger);
if (errorReadingDirectory && paths != null)
{
if (notificationLog.isInfoEnabled())
{
notificationLog.info(String.format("Directory '%s' is available again.", sourceDirectory));
}
}
errorReadingDirectory = (paths == null); // Avoid mailbox flooding.
return (paths == null) ? new File[0] : paths;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment