@Override
  protected String replaceImageUrl(final String cssUri, final String imageUrl) {
    //Can be null when using standalone context.
    final String contextPath = context.getRequest() != null ? context.getRequest().getContextPath() : null;
    final RewriterContext rewriterContext = new RewriterContext().setAggregatedFolderPath(
        context.getAggregatedFolderPath()).setProxyPrefix(getUrlPrefix()).setContextPath(contextPath);

    return new ImageUrlRewriter(rewriterContext).rewrite(cssUri, imageUrl);
  }
@Override
  protected String replaceImageUrl(final String cssUri, final String imageUrl) {
    
    final String contextPath = context.getRequest() != null ? context.getRequest().getContextPath() : null;
    final RewriterContext rewriterContext = new RewriterContext().setAggregatedFolderPath(
        context.getAggregatedFolderPath()).setProxyPrefix(getUrlPrefix()).setContextPath(contextPath);

    return new ImageUrlRewriter(rewriterContext).rewrite(cssUri, imageUrl);
  }
@ Override protected String replaceImageUrl ( final String cssUri , final String imageUrl ) { //Can be null when using standalone context.
 final String contextPath = context . getRequest ( ) != null ? context . getRequest ( ) . getContextPath ( ) : null ; final RewriterContext rewriterContext = new RewriterContext ( ) . setAggregatedFolderPath ( context . getAggregatedFolderPath ( ) ) . setProxyPrefix ( getUrlPrefix ( ) ) . setContextPath ( contextPath ) ; return new ImageUrlRewriter ( rewriterContext ) . rewrite ( cssUri , imageUrl ) ; }
Replace provided url with the new url if needed.

@param cssUri
Uri of the parsed css.
@param imageUrl
to replace.
@return replaced url.
Replace provided url with the new url if needed .