/** * Computes absolute url of the imported resource. * * @param relativeResourceUri uri of the resource containing the import statement. * @param importUrl found import url. * @return absolute url of the resource to import. */ private String computeAbsoluteUrl(final String relativeResourceUri, final String importUrl) { final String folder = WroUtil.getFullPath(relativeResourceUri); // remove '../' & normalize the path. return StringUtils.cleanPath(folder + importUrl); }
/** * Computes absolute url of the imported resource. * * @param relativeResourceUri uri of the resource containing the import statement. * @param importUrl found import url. * @return absolute url of the resource to import. */ private String computeAbsoluteUrl(final String relativeResourceUri, final String importUrl) { final String folder = WroUtil.getFullPath(relativeResourceUri); // remove '../' & normalize the path. final String absoluteImportUrl = StringUtils.cleanPath(folder + importUrl); return absoluteImportUrl; }
final String computedImageLocation = cleanPath(cssUriFolder + processedImageUrl); LOG.debug("computedImageLocation: {}", computedImageLocation); return computedImageLocation;
final String computedImageLocation = cleanPath(cssUriFolder + processedImageUrl); LOG.debug("computedImageLocation: {}", computedImageLocation); return computedImageLocation;
/** * {@inheritDoc} */ public InputStream locate(final String uri) throws IOException { Validate.notNull(uri, "URI cannot be NULL!"); // replace prefix & clean path by removing '..' characters if exists and // normalizing the location to use. String location = StringUtils.cleanPath(uri.replaceFirst(PREFIX, "")).trim(); if (getWildcardStreamLocator().hasWildcard(location)) { try { return locateWildcardStream(uri, location); } catch (final IOException e) { if (location.contains("?")) { location = DefaultWildcardStreamLocator.stripQueryPath(location); LOG.debug("Trying fallback location: {}", location); } } } final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (is == null) { throw new IOException("Couldn't get InputStream from this resource: " + uri); } return is; }
/** * {@inheritDoc} */ public InputStream locate(final String uri) throws IOException { Validate.notNull(uri, "URI cannot be NULL!"); // replace prefix & clean path by removing '..' characters if exists and // normalizing the location to use. String location = StringUtils.cleanPath(uri.replaceFirst(PREFIX, "")).trim(); if (getWildcardStreamLocator().hasWildcard(location)) { try { return locateWildcardStream(uri, location); } catch (final IOException e) { if (location.contains("?")) { location = DefaultWildcardStreamLocator.stripQueryPath(location); LOG.debug("Trying fallback location: {}", location); } } } final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (is == null) { throw new IOException("Couldn't get InputStream from this resource: " + uri); } return is; }