boolean checkForChanges ( ) { // initialize with last checked files final Map < File , byte [ ] > presents = new HashMap <> ( fingerprints ) ; boolean modified = traverseDirectory ( location , new IFileVisitor ( ) { @ Override public boolean visitFile ( File file ) { return modified ( presents . remove ( file ) , file ) ; } @ Override public boolean visitDir ( File dir ) { return modified ( presents . remove ( dir ) , dir ) ; } } ) ; // if some files remain, that means they have been deleted since last scan return modified || ! presents . isEmpty ( ) ; }
Check if files in the certificate folders have been added or removed .