public static String getCacheBustedUrl ( String url , ResourceReaderHandler rsReader , JawrConfig jawrConfig ) throws IOException , ResourceNotFoundException { String checksum = getChecksum ( url , rsReader , jawrConfig ) ; String result = JawrConstant . CACHE_BUSTER_PREFIX ; boolean generatedBinaryResource = jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( url ) ; if ( generatedBinaryResource ) { int idx = url . indexOf ( GeneratorRegistry . PREFIX_SEPARATOR ) ; String generatorPrefix = url . substring ( 0 , idx ) ; url = url . substring ( idx + 1 ) ; result = generatorPrefix + "_cb" ; } result = result + checksum ; if ( ! url . startsWith ( "/" ) ) { result = result + "/" ; } // Add the cache buster extension return PathNormalizer . asPath ( result + url ) ; }
Return the cache busted url associated to the url passed in parameter if the resource is not found null will b returned .