Exemplo n.º 1
0
        /// <summary>
        /// Converts unc path to regular path
        /// </summary>
        /// <exception cref="InvalidOperationException">If path is invalid or cannot be identified</exception>
        public static String ToPathRegular(String path)
        {
            Contract.Requires(!String.IsNullOrEmpty(path));
            Contract.Ensures(!String.IsNullOrEmpty(Contract.Result <String>()));


            // convert to share
            if (IsShareUnc(path))
            {
                return(QuickIOPath.ToSharePathRegular(path));
            }
            // convert to local
            if (IsLocalUnc(path))
            {
                return(QuickIOPath.ToLocalPathRegular(path));
            }

            // give origin if already regular
            if (IsShareRegular(path) || IsLocalRegular(path))
            {
                // already regular
                return(path);
            }


            // it is already a regular path
            // or invalid. but will not be checked here
            return(path);
        }