Pchp.Library.PhpPath.GetUrl C# (CSharp) Method

GetUrl() static private method

Concatenates a scheme with the given absolute path if necessary.
Invalid path.
static private GetUrl ( string absolutePath ) : string
absolutePath string Absolute path.
return string
        internal static string GetUrl(string/*!*/ absolutePath)
        {
            // Assert that the path is absolute
            //Debug.Assert(
            //    !string.IsNullOrEmpty(absolutePath) &&
            //    (absolutePath.IndexOf(':') > 0 ||   // there is a protocol (http://) or path is rooted (c:\)
            //        (Path.VolumeSeparatorChar != ':' && // or on linux, if there is no protocol, file path is rooted
            //            (absolutePath[0] == Path.DirectorySeparatorChar || absolutePath[0] == Path.AltDirectorySeparatorChar)))
            //    );

            if (Path.IsPathRooted(absolutePath))
                return String.Concat("file://", absolutePath);

            // Otherwise assume that it's the string before first ':'.
            return absolutePath;
        }