jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java
/**
	 * Returns the link to the bundle
	 * 
	 * @param handler
	 *            the resource bundles handler
	 * @param path
	 *            the path
	 * @param variantKey
	 *            the local variant key
	 * @return the link to the bundle
	 * @throws IOException
	 *             if an IO exception occurs
	 */
Returns the link to the bundle


Returns the link to the bundle
protected List<RenderedLink> createLinkToBundle(
			ResourceBundlesHandler handler, String path, String resourceType,
			Map<String, String> variantMap) throws IOException {
		ArrayList<RenderedLink> linksToBundle = new ArrayList<RenderedLink>();
		BasicBundleRenderer bundleRenderer = new BasicBundleRenderer(handler,
				resourceType);
		StringWriter sw = new StringWriter();
		boolean useGzip = false;
		boolean isSslRequest = false;
		handler.getConfig().setDebugModeOn(false);
		handler.getConfig().setGzipResourcesModeOn(useGzip);
		BundleRendererContext ctx = new BundleRendererContext("", variantMap,
				useGzip, isSslRequest);
		bundleRenderer.renderBundleLinks(path, ctx, sw);
		handler.getConfig().setDebugModeOn(true);
		ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest);
		bundleRenderer.renderBundleLinks(path, ctx, sw);
		List<RenderedLink> renderedLinks = bundleRenderer.getRenderedLinks();
		String contextPathOverride = handler.getConfig()
				.getContextPathOverride();
		for (Iterator<RenderedLink> iterator = renderedLinks.iterator(); iterator
				.hasNext();) {
			RenderedLink renderedLink = iterator.next();
			String renderedLinkPath = renderedLink.getLink();
			if (StringUtils.isNotEmpty(contextPathOverride)
					&& renderedLinkPath.startsWith(contextPathOverride)) {
				renderedLinkPath = renderedLinkPath
						.substring(contextPathOverride.length());
			}
			renderedLink.setLink(PathNormalizer.asPath(renderedLinkPath));
			linksToBundle.add(renderedLink);
		}
		return linksToBundle;
	}
protected List < RenderedLink > createLinkToBundle ( ResourceBundlesHandler handler , String path , String resourceType , Map < String , String > variantMap ) throws IOException { ArrayList < RenderedLink > linksToBundle = new ArrayList < RenderedLink > ( ) ; BasicBundleRenderer bundleRenderer = new BasicBundleRenderer ( handler , resourceType ) ; StringWriter sw = new StringWriter ( ) ; boolean useGzip = false ; boolean isSslRequest = false ; handler . getConfig ( ) . setDebugModeOn ( false ) ; handler . getConfig ( ) . setGzipResourcesModeOn ( useGzip ) ; BundleRendererContext ctx = new BundleRendererContext ( "" , variantMap , useGzip , isSslRequest ) ; bundleRenderer . renderBundleLinks ( path , ctx , sw ) ; handler . getConfig ( ) . setDebugModeOn ( true ) ; ctx = new BundleRendererContext ( "" , variantMap , useGzip , isSslRequest ) ; bundleRenderer . renderBundleLinks ( path , ctx , sw ) ; List < RenderedLink > renderedLinks = bundleRenderer . getRenderedLinks ( ) ; String contextPathOverride = handler . getConfig ( ) . getContextPathOverride ( ) ; for ( Iterator < RenderedLink > iterator = renderedLinks . iterator ( ) ; iterator . hasNext ( ) ; ) { RenderedLink renderedLink = iterator . next ( ) ; String renderedLinkPath = renderedLink . getLink ( ) ; if ( StringUtils . isNotEmpty ( contextPathOverride ) && renderedLinkPath . startsWith ( contextPathOverride ) ) { renderedLinkPath = renderedLinkPath . substring ( contextPathOverride . length ( ) ) ; } renderedLink . setLink ( PathNormalizer . asPath ( renderedLinkPath ) ) ; linksToBundle . add ( renderedLink ) ; } return linksToBundle ; }
Returns the link to the bundle
Returns the link to the bundle
// The gzip compression will be made by the CDN server // So we force it to false. // The generation of bundle is the same in SSL and non SSL mode // First deals with the production mode // Then take in account the debug mode // Remove context override path if it's defined. // Remove the context path override