/** * 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; }
public String computeRelativeResourceUri(final String originalResourceUri, final String relativePath) { final String fullPath = WroUtil.getFullPath(originalResourceUri) + relativePath; return WroUtil.normalize(fullPath); } }
/** * 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); }
public String computeRelativeResourceUri(final String originalResourceUri, final String relativePath) { final String fullPath = WroUtil.getFullPath(originalResourceUri) + relativePath; return WroUtil.normalize(fullPath); } }
/** * TODO this is duplicated code (from super) -> find a way to reuse it. */ private InputStream locateStreamWithContextFolder(final String uri, final String contextFolder) throws IOException, FileNotFoundException { if (getWildcardStreamLocator().hasWildcard(uri)) { final String fullPath = WroUtil.getFullPath(uri); final String realPath = contextFolder + fullPath; return getWildcardStreamLocator().locateStream(uri, new File(realPath)); } final String uriWithoutPrefix = uri.replaceFirst(PREFIX, EMPTY); final File file = new File(contextFolder, uriWithoutPrefix); LOG.debug("Opening file: " + file.getPath()); return new FileInputStream(file); }
/** * TODO this is duplicated code (from super) -> find a way to reuse it. */ private InputStream locateStreamWithContextFolder(final String uri, final String contextFolder) throws IOException, FileNotFoundException { if (getWildcardStreamLocator().hasWildcard(uri)) { final String fullPath = WroUtil.getFullPath(uri); final String realPath = contextFolder + fullPath; return getWildcardStreamLocator().locateStream(uri, new File(realPath)); } final String uriWithoutPrefix = uri.replaceFirst(PREFIX, ""); final File file = new File(contextFolder, uriWithoutPrefix); LOG.debug("Opening file: " + file.getPath()); return new FileInputStream(file); } }
fullPath = WroUtil.getFullPath(cssUri) + cleanImageUrl;
fullPath = WroUtil.getFullPath(cssUri) + cleanImageUrl;