Android Utililty Methods Path Check

List of utility methods to do Path Check


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


get User Current Dir
return new File(System.getProperty(SYS_PROP_USER_CURRENT_DIR));
booleanisAbsolutePath(String path)
Determines if the path specified by a given String is an absolute path or not.
if (StringUtil.nullOrEmptyOrBlankString(path)) {
    return false;
if (SystemUtil.isWin32()) {
    int indexToSearch = path.indexOf(":") + 1;
    return (path.startsWith("\\", indexToSearch) ||
    path.startsWith("/", indexToSearch));
return path.startsWith("/");
booleanisLikelyFilePath(String s)
Return whether or not the provided string is possibly a valid file path.
if (s == null || s.trim().length() == 0) {
    return false;
return Pattern.matches(FILE_PATH_PATTERN, s);