Java Utililty Methods Path Normalize

List of utility methods to do Path Normalize

Description

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

Method

StringnormalizeZKPath(String basePath, String child)
normalize ZK Path
while (basePath.endsWith("/")) {
    basePath = basePath.substring(0, basePath.length() - 2);
while (child.startsWith("/")) {
    child = child.substring(1);
return basePath + "/" + child;
StringnormPathSeparator(String string)
Puts a path separator at end of a string if missing.
if (string == null) {
    return "";
if (!string.endsWith(System.getProperty("file.separator"))) {
    return string + System.getProperty("file.separator");
return string;