protected string NormalizePath(string path, bool allowRootPath = false) { if (string.IsNullOrEmpty(path) || path[0] != PathSeparator || path.IndexOf(m_emptyPathSegment, StringComparison.Ordinal) >= 0 || (!allowRootPath && path.Length == 1)) { throw new ArgumentException(CommonResources.InvalidClientStoragePath(path, PathSeparator), "path"); } if (path[path.Length - 1] == PathSeparator) { path = path.Substring(0, path.Length - 1); } return(path); }