Resolves the path relative to the parent and normalizes it.

@param parent the parent path
@param path   the path

@return the normalized path
557742
protected Path normalizePath(final Path parent, final String path) {
        return parent.resolve(path).toAbsolutePath().normalize();
    }
677442
public static <T extends Comparable<?>> ComparablePath<T> comparablePath(Class<? extends T> type,
            Path<?> parent, String property) {
        return new ComparablePath<T>(type, PathMetadataFactory.forProperty(parent, property));
    }
1296436
public static <KT> PathMetadata forMapAccess(Path<?> parent, KT key) {
        return new PathMetadata(parent, key, PathType.MAPVALUE_CONSTANT);
    }
23991
protected String normalizePath(String path) {

        if (path.equals("/")) {
            return path;
        } else {
            return CmsFileUtil.removeTrailingSeparator(path);
        }

    }
684801
public static String normalizePath(String path) {
    String normalizedPath = path.replaceAll("//+", "/").replaceFirst("(.+)/$", "$1");
    PathUtils.validatePath(normalizedPath);
    return normalizedPath;
  }
1304832
protected String getRelativePath(String ancestor, String rootPath) {

        String result = rootPath.substring(ancestor.length());
        result = CmsStringUtil.joinPaths("/", result, "/");
        return result;
    }
24400
public function resolve($parent_path, $child_path) {
        if (!is_string($parent_path)) {
            throw new \InvalidArgumentException("The first path param must be string.");
        }
        if (!is_string($child_path)) {
            throw new \InvalidArgumentException("The child Path param must be string.");
        }
        $real_path = null;
        if ('/' === substr($child_path, 0, 1)) {
            $real_path = $child_path;
        } elseif (preg_match('#^[a-zA-Z]:[\/\\\]#', $child_path)) {
            $real_path = $child_path;
        } else {
            if (\is_dir($parent_path)) {
                // Resolve as a relative path join.
                $real_path = $parent_path . '/' . $child_path;
            } else {
                // Resolve as a file position search.
                $real_path = dirname($parent_path) . '/' . $child_path;
            }
        }
        return $this->normalize($real_path);
    }
403525
function normalizeRoute(path, parent) {
  if (path[0] === '/' || path[0] === '') {
    return path;  // absolute route
  }
  if (!parent) {
    return path;  // no need for a join
  }
  return `${parent.route}/${path}`; // join
}
678061
public ModulePath resolve(String path) {
    return new ModulePath(normalize(pathEscaper.escape(pathResolver.apply(path)), moduleRootPaths));
  }
356588
private static void joinPath(StringBuilder path, String parent, String child)
    {
        // Add parent piece, with no trailing slash.
        if ( (parent != null) && (parent.length() > 0) )
        {
            if ( !parent.startsWith(PATH_SEPARATOR) )
            {
                path.append(PATH_SEPARATOR);
            }
            if ( parent.endsWith(PATH_SEPARATOR) )
            {
                path.append(parent.substring(0, parent.length() - 1));
            }
            else
            {
                path.append(parent);
            }
        }

        if ( (child == null) || (child.length() == 0) || (child.equals(PATH_SEPARATOR)) )
        {
            // Special case, empty parent and child
            if ( path.length() == 0 )
            {
                path.append(PATH_SEPARATOR);
            }
            return;
        }

        // Now add the separator between parent and child.
        path.append(PATH_SEPARATOR);

        if ( child.startsWith(PATH_SEPARATOR) )
        {
            child = child.substring(1);
        }

        if ( child.endsWith(PATH_SEPARATOR) )
        {
            child = child.substring(0, child.length() - 1);
        }

        // Finally, add the child.
        path.append(child);
    }
1074752
protected function _inpath($path, $parent) {
		$real_path = realpath($path);
		$real_parent = realpath($parent);
		if ($real_path && $real_parent) {
			return $real_path === $real_parent || strpos($real_path, rtrim($real_parent, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR) === 0;
		}
		return false;
	}
1311699
public static String normalizePath(String path) {
		String retval = path;
		retval = retval.replaceAll(PathUtils.REGEX_MULTIPLE_SLASH,
				PathUtils.REGEX_SLASH);
		retval = retval.replaceAll(PathUtils.REGEX_BACKSLASH,
				PathUtils.REGEX_SLASH);
		return retval;
	}
1221439
private String normalizeActionPath(Resource parent, String uri) {
        String relativeUri = extractRelativeUrl(uri, parent.getUri());
        if (!relativeUri.startsWith("/")) {
            relativeUri = "/" + relativeUri;
        }
        return relativeUri;
    }
344589
public static String getRelativePathName(Path root, Path path) {
        Path relative = root.relativize(path);
        return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
    }
97656
String getParent(String path) {
    return path.substring(0, path.lastIndexOf(Path.SEPARATOR));
  }
893730
def parent_folder(path, base=None):
    
    return path and os.path.dirname(resolved_path(path, base=base))
890409
public static String normalizePath(String path) {
        requireNonNull(path, "path");
        if (path.isEmpty()) {
            return "/";
        }

        if (!path.startsWith("/")) {
            path = '/' + path;
        }

        if (!path.endsWith("/")) {
            path += '/';
        }

        return path.replaceAll("//+", "/");
    }