class VFSManager extends BasicManager {

    public static String sanitizePath(String path) {
        // check for "empty" paths
        if (path == null || path.length() == 0)
            return "/";
        // prepend "/" if missing
        if (path.charAt(0) != '/')
            path = "/" + path;
        // cut trailing slash if any
		if (path.length() > 1 && path.charAt(path.length() - 1) == '/') path = path.substring(0, path.length() - 1);
        return path;
    }

}