private static String calculateRelativePath(String uri, String base, boolean fileUrl) { // if this is a file URL (very likely), and if this is on a case-insensitive file system, // then treat it accordingly. boolean onWindows = File.pathSeparatorChar==';'; if (base == null) { return null; } if ((fileUrl && onWindows && startsWithIgnoreCase(uri,base)) || uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base), fileUrl); } }
private static String calculateRelativePath(String uri, String base, boolean fileUrl) { // if this is a file URL (very likely), and if this is on a case-insensitive file system, // then treat it accordingly. boolean onWindows = File.pathSeparatorChar==';'; if (base == null) { return null; } if ((fileUrl && onWindows && startsWithIgnoreCase(uri,base)) || uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base), fileUrl); } }
private static String calculateRelativePath(String uri, String base) { if (base == null) { return null; } if (uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base)); } }
private static String calculateRelativePath(String uri, String base) { if (base == null) { return null; } if (uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base)); } }
private static String calculateRelativePath(String uri, String base) { if (base == null) { return null; } if (uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base)); } }
private static String calculateRelativePath(String uri, String base, boolean fileUrl) { // if this is a file URL (very likely), and if this is on a case-insensitive file system, // then treat it accordingly. boolean onWindows = File.pathSeparatorChar==';'; if (base == null) { return null; } if ((fileUrl && onWindows && startsWithIgnoreCase(uri,base)) || uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base), fileUrl); } }
private static String calculateRelativePath(String uri, String base, boolean fileUrl) { // if this is a file URL (very likely), and if this is on a case-insensitive file system, // then treat it accordingly. boolean onWindows = File.pathSeparatorChar==';'; if (base == null) { return null; } if ((fileUrl && onWindows && startsWithIgnoreCase(uri,base)) || uri.startsWith(base)) { return uri.substring(base.length()); } else { return "../" + calculateRelativePath(uri, getParentUriPath(base), fileUrl); } }