public static String trimPathSeparatorBothSides(String path) {
		int len = path.length();
		int st = 0;
		int off = 0;
		char[] val = path.toCharArray();
		while ((st < len) && (val[off + st] == '/')) {
			st++;
		}
		while ((st < len) && (val[off + len - 1] == '/')) {
			len--;
		}
		return ((st > 0) || (len < path.length())) ? path.substring(st, len) : path;
	}
Trim both leading and tailing of the path separator '/' from the given path.

@param path the given path
@return a path which is removed the path separator both sides
ngrinder-core/src/main/java/org/ngrinder/common/util/PathUtils.java