private Reader getResourceReader ( JoinableResourceBundle bundle , String originalPath , ResourceReaderHandler readerHandler , String skinRootDir , String [ ] paths , Map < String , String > variantMap ) { Reader reader = null ; StringBuilder path = new StringBuilder ( skinRootDir ) ; String skinVariant = ( String ) variantMap . get ( JawrConstant . SKIN_VARIANT_TYPE ) ; String localeVariant = ( String ) variantMap . get ( JawrConstant . LOCALE_VARIANT_TYPE ) ; if ( skinMappingType . equals ( JawrConstant . SKIN_TYPE_MAPPING_SKIN_LOCALE ) ) { paths [ 0 ] = skinVariant ; if ( localeVariant != null ) { paths [ 1 ] = localeVariant ; } } else { paths [ 0 ] = localeVariant ; if ( skinVariant != null ) { paths [ 1 ] = skinVariant ; } } for ( int i = 0 ; i < paths . length ; i ++ ) { path . append ( paths [ i ] ) ; if ( i + 1 < paths . length ) { path . append ( JawrConstant . URL_SEPARATOR ) ; } } try { String finalPath = path . toString ( ) ; reader = readerHandler . getResource ( bundle , finalPath ) ; // Rewrite URL if the final CSS path is not the original one if ( ! originalPath . equals ( finalPath ) ) { String content = IOUtils . toString ( reader ) ; StringBuffer result = urlRewriter . rewriteUrl ( finalPath , originalPath , content ) ; reader = new StringReader ( result . toString ( ) ) ; } } catch ( ResourceNotFoundException | IOException e ) { // Nothing to do } return reader ; }
Returns the reader for the resource path defined in parameter