Java Utililty Methods Path Is Absolute

List of utility methods to do Path Is Absolute

Description

The list of methods to do Path Is Absolute are organized into topic(s).

Method

booleanisAbsolute(final String path)
is Absolute
return path.startsWith("/") || isURL(path);
booleanisAbsolute(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;
...
booleanisAbsolute(String path)
Check if a chunk path is absolute
return path != null && !path.isEmpty() && path.charAt(0) == '/';
booleanisAbsolute(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("/");
booleanisAbsolute(String path)
Whether the path is absolute (starts with a slash) or not.
assert isValid(path);
return isAbsolutePath(path);
booleanisAbsolutePath(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;
...
booleanisAbsolutePath(String path)
is Absolute Path
boolean isWindows = getPlatform().startsWith("win");
if (isWindows)
    return path.length() > 1 && path.charAt(1) == ':';
return path.startsWith("/");
booleanisAbsolutePath(String path)
is Absolute Path
return path.startsWith("/");
booleanisAbsolutePath(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);
booleanisAbsolutePath(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);
...