protected List < FileSource > doScan ( File fDir ) { List < FileSource > ret = new ArrayList <> ( ) ; if ( fDir != null && fDir . exists ( ) && ! fDir . isHidden ( ) ) { for ( final File entry : fDir . listFiles ( ) ) { if ( entry . isHidden ( ) ) { continue ; } if ( ! entry . isDirectory ( ) ) { this . scFiles ++ ; if ( entry . canRead ( ) ) { ret . add ( new FileSource ( entry , this . source . getSetRootPath ( ) ) ) ; } else { this . scFilesUnreadable ++ ; this . warnings . add ( "found file <" + entry . getAbsolutePath ( ) + "> but cannot read, ignore" ) ; } } else if ( entry . isDirectory ( ) ) { this . scDir ++ ; if ( entry . canRead ( ) ) { ret . addAll ( this . doScan ( entry ) ) ; } else { this . scDirUnreadable ++ ; this . warnings . add ( "found directory <" + entry . getAbsolutePath ( ) + "> but cannot read, ignore" ) ; } } } } return ret ; }
Does the actual scan of a directory .