"/.." at the beginning should be removed as browsers do (not in RFC).

@param path the path
@return the cleaned string defining the path.
511699
private static String removeLeadingSlashPoints(String path) {
		while (path.startsWith("/..")) {
			path = path.substring(3);
		}

		return path;
	}
372603
public static final String normalizePath(String path) {
		String normalizedPath = path.replaceAll("//", JawrConstant.URL_SEPARATOR);
		StringTokenizer tk = new StringTokenizer(normalizedPath, JawrConstant.URL_SEPARATOR);
		StringBuilder sb = new StringBuilder();
		while (tk.hasMoreTokens()) {
			sb.append(tk.nextToken());
			if (tk.hasMoreTokens())
				sb.append(JawrConstant.URL_SEPARATOR);
		}
		return sb.toString();

	}
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;
	}
204243
private String removeFinalSlash(String path) {
        if (path != null && !path.isEmpty() && path.endsWith("/")) {
            return path.substring(0, path.length() -1);
        }

        return path;
    }
1270031
public static String clean(final String path) {
        return clean(path.replace(WINDOWS_SEPARATOR, UNIX_SEPARATOR), true);
    }
1335813
public static String removeRelativeParts(final String path) {

		String partialPath = "";

		for (String part : PathHelper.getParts(path)) {

			// ignore ".." and "." in paths
			if ("..".equals(part) || ".".equals(part)) {
				continue;
			}

			partialPath += PathHelper.PATH_SEP + part;
		}

		return partialPath;
	}
1183132
public static String resolve(String path) {
        if (path == null) {
            return null;
        }
        if (path.startsWith("~" + File.separator)) {
            return SystemUtil.getUserHome() + path.substring(1);
        }
        return path;
    }
391504
private static String removeSlashes(String path) {
        String retString = path;
        String slash = System.getProperty("file.separator");

        //if non-Unix slashes replace
        retString = retString.replace(slash, "/");

        retString = retString.replaceFirst("^/", "");
        retString = retString.replaceFirst("/$", "");

        return retString;
    }
232567
private String normalizeFilePath(final String path) {
        String normalizedPath = path.replace('\\', '/');

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

        return normalizedPath;
    }
675979
public static String trimLastPathSection(String path) {
        String[] sections = path.split("/");
        StringBuilder newPath = new StringBuilder("/");
        for (int i = 1; i < sections.length - 1; i++) {
            newPath.append(sections[i]).append("/");
        }
        return newPath.toString();
    }
232521
public static String optionallyPrependSlash(final String path) {
        // Adjust null
        String resolved = path;
        if (resolved == null) {
            resolved = EMPTY;
        }

        // If the first character is not a slash
        if (!isFirstCharSlash(resolved)) {
            // Prepend the slash
            return ArchivePath.SEPARATOR + resolved;
        }

        // Return as-is
        return resolved;
    }
1367207
public static String normalizePath(String path) {
		if (Platforms.FILE_PATH_SEPARATOR_CHAR == Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR
				&& StringUtils.indexOf(path, Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR) != -1) {
			return StringUtils.replaceChars(path, Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR,
					Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR);
		}
		return path;

	}
749343
public static String decodePath(String path) {
        URI tmp;

        try {
            tmp = new URI("scheme://host/" + path);
        } catch (URISyntaxException e) {
            throw new IllegalStateException(e);
        }
        return tmp.getPath().substring(1);
    }
893111
private String pathToProperty(String path) {
        if (path == null || !path.startsWith("/")) {
            throw new IllegalArgumentException("Path must be prefixed with a \"/\".");
        }
        return path.substring(1);
    }
1182751
protected String getCleanPath( String path ) {

        if (path.endsWith("/") && path.length() > 1) {
            path = path.substring(0, path.length() - 1);
        }
        return path;
    }
175160
public static String normalizeResourcePath(final String path) {
		if (path == null) {
			return null;
		}
		String normalizedPath = replaceSlashes(path.trim());
		if (normalizedPath.startsWith("/") && normalizedPath.length() > 1) {
			normalizedPath = normalizedPath.substring(1);
		}
		return normalizedPath;
	}
1331096
@Nullable
  public static String getFilename(@Nullable final String path) {
    if (path == null) {
      return null;
    }

    final int separatorIndex = path.lastIndexOf(StringUtils.FOLDER_SEPARATOR);
    return separatorIndex != -1 ? path.substring(separatorIndex + 1) : path;
  }