private Map < String , VariantSet > getVariants ( ResourceBrowser rsBrowser , String rootDir , String defaultSkinName , String defaultLocaleName , boolean mappingSkinLocale ) { Set < String > paths = rsBrowser . getResourceNames ( rootDir ) ; Set < String > skinNames = new HashSet <> ( ) ; Set < String > localeVariants = new HashSet <> ( ) ; for ( Iterator < String > itPath = paths . iterator ( ) ; itPath . hasNext ( ) ; ) { String path = rootDir + itPath . next ( ) ; if ( rsBrowser . isDirectory ( path ) ) { String dirName = PathNormalizer . getPathName ( path ) ; if ( mappingSkinLocale ) { skinNames . add ( dirName ) ; // check if there are locale variants for this skin, // and update the localeVariants if needed updateLocaleVariants ( rsBrowser , path , localeVariants ) ; } else { if ( LocaleUtils . LOCALE_SUFFIXES . contains ( dirName ) ) { localeVariants . add ( dirName ) ; // check if there are skin variants for this locales, // and update the skinVariants if needed updateSkinVariants ( rsBrowser , path , skinNames ) ; } } } } // Initialize the variant mapping for the skin root directory return getVariants ( defaultSkinName , skinNames , defaultLocaleName , localeVariants ) ; }
Initialize the skinMapping from the parent path