public String computeRelativeResourceUri(final String originalResourceUri, final String relativePath) { final String fullPath = WroUtil.getFullPath(originalResourceUri) + relativePath; return WroUtil.normalize(fullPath); } }
public String computeRelativeResourceUri(final String originalResourceUri, final String relativePath) { final String fullPath = WroUtil.getFullPath(originalResourceUri) + relativePath; return WroUtil.normalize(fullPath); } }
/** * @return the path to be prefixed after css aggregation. This depends on the aggregated css destination folder. This * is a fix for the following issue: {@link http://code.google.com/p/wro4j/issues/detail?id=259} */ private String computeAggregationPathPrefix(final String aggregatedFolderPath) { LOG.debug("aggregatedFolderPath: {}", aggregatedFolderPath); String computedPrefix = StringUtils.EMPTY; if (aggregatedFolderPath != null) { final StringBuffer result = new StringBuffer(""); final String[] depthFolders = WroUtil.normalize(aggregatedFolderPath).split(ROOT_CONTEXT_PATH); LOG.debug("subfolders {}", Arrays.toString(depthFolders)); for (final String folder : depthFolders) { if (!StringUtils.isEmpty(folder)) { result.append(FOLDER_PREFIX); } } computedPrefix = result.toString().replaceFirst(ROOT_CONTEXT_PATH, ""); } LOG.debug("computedPrefix: {}", computedPrefix); return computedPrefix; }
/** * @return the path to be prefixed after css aggregation. This depends on the aggregated css destination folder. This * is a fix for the following issue: {@link http://code.google.com/p/wro4j/issues/detail?id=259} */ private String computeAggregationPathPrefix(final String aggregatedFolderPath) { LOG.debug("aggregatedFolderPath: {}", aggregatedFolderPath); String computedPrefix = StringUtils.EMPTY; if (aggregatedFolderPath != null) { final StringBuffer result = new StringBuffer(StringUtils.EMPTY); final String[] depthFolders = WroUtil.normalize(aggregatedFolderPath).split(ROOT_CONTEXT_PATH); LOG.debug("subfolders {}", Arrays.toString(depthFolders)); for (final String folder : depthFolders) { if (!StringUtils.isEmpty(folder)) { result.append(FOLDER_PREFIX); } } computedPrefix = result.toString().replaceFirst(ROOT_CONTEXT_PATH, StringUtils.EMPTY); } LOG.debug("computedPrefix: {}", computedPrefix); return computedPrefix; }
/** * Use this factory method when you want to use the {@link SmartWroModelFactory} in standalone (maven plugin) context. * The autoDetect flag is set to true if the wroFile path is the same as the default wro file name. */ public static SmartWroModelFactory createFromStandaloneContext(final StandaloneContext context) { Validate.notNull(context); final boolean autoDetectWroFile = WroUtil.normalize(context.getWroFile().getPath()).contains( WroUtil.normalize(DEFAULT_WRO_FILE)); if (!autoDetectWroFile) { LOG.debug("autoDetect is " + autoDetectWroFile + " because wroFile: " + context.getWroFile() + " is not the same as the default one: " + DEFAULT_WRO_FILE); } return new SmartWroModelFactory().setWroFile(context.getWroFile()).setAutoDetectWroFile(autoDetectWroFile); }
/** * Use this factory method when you want to use the {@link SmartWroModelFactory} in standalone (maven plugin) context. * The autoDetect flag is set to true if the wroFile path is the same as the default wro file name. */ public static SmartWroModelFactory createFromStandaloneContext(final StandaloneContext context) { notNull(context); final boolean autoDetectWroFile = WroUtil.normalize(context.getWroFile().getPath()).contains( WroUtil.normalize(DEFAULT_WRO_FILE)); if (!autoDetectWroFile) { LOG.debug("autoDetect is " + autoDetectWroFile + " because wroFile: " + context.getWroFile() + " is not the same as the default one: " + DEFAULT_WRO_FILE); } return new SmartWroModelFactory().setWroFile(context.getWroFile()).setAutoDetectWroFile(autoDetectWroFile); }