private void tryScanFile ( ) { if ( ! isScanned ) { synchronized ( AssetsWebsite . class ) { if ( ! isScanned ) { List < String > fileList = mReader . scanFile ( mRootPath ) ; for ( String filePath : fileList ) { String httpPath = filePath . substring ( mRootPath . length ( ) , filePath . length ( ) ) ; httpPath = addStartSlash ( httpPath ) ; mPatternMap . put ( httpPath , filePath ) ; String indexFileName = getIndexFileName ( ) ; if ( filePath . endsWith ( indexFileName ) ) { httpPath = filePath . substring ( 0 , filePath . indexOf ( indexFileName ) - 1 ) ; httpPath = addStartSlash ( httpPath ) ; mPatternMap . put ( httpPath , filePath ) ; mPatternMap . put ( addEndSlash ( httpPath ) , filePath ) ; } } isScanned = true ; } } } }
Try to scan the file no longer scan if it has already been scanned .