|
From: David K. <dav...@al...> - 2003-09-24 13:40:55
|
Dejan Krsmanovic wrote: > Hi David, Hi again, Dejan, and list, [snipped Dejan's suggestions regarding the DirectoryScanner] I have read source, coded and tested a bit, and come up with a new version of the patch to the DirectoryScanner. This one: - Integrates the file-age criteria into the filter mechanism already present in the DirectoryScanner - Creates a new private method boolean acceptFile(File file) that gets called instead of the original acceptEntry, but calls acceptEntry itself, in addition to the age check, allowing for easily extending acceptFile to do more things - Changes the name from minLastModified to minimumFileAge, both in the code as well as for the configuration parameter - Makes the parameter optional with default value of 0 (zero), i.e it behaves exactly as before and is backwards compatible - Externalizes the description of the configuration parameter into the messages.properties for the scanner module - Does not sleep any more, since it merely ignores the file if it is too young, until next scanner phase, when it gets a new chance to be considered for processing again - Gracefully handles the removal of files between scannings, since it has no memory of what files were there last time - Totally fails to handle the case where the sender deliberately (or not) uploads an invalid file... ;-) Patch, against both messages.properties and DirectoryScanner.java is attached. Please review and comment. Regards, David |