public static String relativize(File from, File to) { URI fromURI = from.toURI(); URI toURI = to.toURI(); String relative = getRelativePath(fromURI.toString(), toURI.toString(), URIUtils.URI_FILE_SEPARATOR); relative = convertUriToPlatformSeparator(relative); return relative; }
public static String relativizeSourceURIs(LessSource from, LessSource to) { if (to == null) return null; URI toURI = to.getURI(); if (toURI == null) return to.getName(); String toURIAsString = toURI.toString(); if (from == null) return toURIAsString; URI fromURI = from.getURI(); if (fromURI == null) return toURIAsString; String fromURIAsString = fromURI.toString(); return getRelativePath(fromURIAsString, toURIAsString, URIUtils.URI_FILE_SEPARATOR); }