List of utility methods to do Path Create Canonical
String | canonicalPath(String orig) Canonicalize a request path, making sure it starts with a slash, and getting rid of double slashes and components with the values "." or ".." .
if (orig.length() == 0) { return "/"; if (orig.charAt(0) != '/') { orig = '/' + orig; for (;;) { int foundAt = orig.indexOf("//"); ... |
String | canonicalpath(String path) Convert path to: 1. if (path == null) return null; path = path.trim(); path = path.replace('\\', '/'); if (path.endsWith("/")) path = path.substring(0, path.length() - 1); if (hasDriveLetter(path)) path = path.substring(0, 1).toLowerCase() + path.substring(1); ... |
String | canonicalPath(String path) Convert a path to a cananonical form. if (path == null || path.length() == 0) return path; int end = path.length(); int start = path.lastIndexOf('/', end); search: while (end > 0) { switch (end - start) { case 2: if (path.charAt(start + 1) != '.') ... |
String | canonicalpath(String path, boolean relative) Convert path to: 1. if (path == null) return null; path = path.trim(); path = path.replace('\\', '/'); if (path.endsWith("/")) path = path.substring(0, path.length() - 1); if (relative && path.startsWith("/")) path = path.substring(1); ... |