class PathUtil {

	public static String getName(String path) {
		if (path == "/") {
			return "/";
		}
		List<String> groups = RegexUtil.groups("^/*(([^/]+))/*$", path);
		if (groups.size() > 1) {
			return groups.get(1);
		}

		groups = RegexUtil.groups("^.*/+(([^/]+))/*$", path);
		return groups.get(1);
	}

}