List of utility methods to do Path Is Absolute
boolean | isAbsolute(final String path) is Absolute return path.startsWith("/") || isURL(path); |
boolean | isAbsolute(String aPath) Determine if the given String represents an absolute path by checking if the string starts with a '/' or is a URI that starts with a scheme 'scheme:/'. boolean absolute = false; String path = aPath.replace('\\', '/'); if (path.indexOf(':') > 0 && path.indexOf('/') > path.indexOf(':')) { absolute = true; else if (path.startsWith("/")) absolute = true; ... |
boolean | isAbsolute(String path) Check if a chunk path is absolute return path != null && !path.isEmpty() && path.charAt(0) == '/'; |
boolean | isAbsolute(String path) Determines if a path is absolute or not by testing for the presence of "/" at the front of the string. return path.startsWith("/"); |
boolean | isAbsolute(String path) Whether the path is absolute (starts with a slash) or not. assert isValid(path); return isAbsolutePath(path); |
boolean | isAbsolutePath(String filename) Returns whether a filename represents an absolute path. if (filename.startsWith("/") || filename.startsWith("~")) { return true; if (filename.length() > 2 && Character.isLetter(filename.charAt(0)) && filename.charAt(1) == ':') { return true; if (filename.startsWith("\\\\")) { return true; ... |
boolean | isAbsolutePath(String path) is Absolute Path boolean isWindows = getPlatform().startsWith("win"); if (isWindows) return path.length() > 1 && path.charAt(1) == ':'; return path.startsWith("/"); |
boolean | isAbsolutePath(String path) is Absolute Path return path.startsWith("/"); |
boolean | isAbsolutePath(String path) is Absolute Path if (path == null || path.trim().length() == 0) { throw new NullPointerException("Path can't be null or empty."); return path.startsWith(SLASH); |
boolean | isAbsolutePath(String path) is Absolute Path String osNameStart = System.getProperty("os.name").substring(0, 3); String fileSeparator = System.getProperty("file.separator"); if (osNameStart.equals("Win")) { return ((path.length() > 1) && path.substring(1, 2).equals(":")) || path.startsWith(fileSeparator); } else if (osNameStart.equals("Mac")) { return path.startsWith(fileSeparator); } else { return path.startsWith(fileSeparator); ... |