public static boolean isNormalizedPathAbsolute ( String nPath ) { boolean retval = ".." . equals ( nPath ) || nPath . startsWith ( "../" ) || nPath . startsWith ( "/.." ) ; //System.out.println("returning " + retval); return ! retval ; }
Tell if a path if applied to a target location will reach above the target location . The path must use forward slashes and must have all .. elements resolved .