Batman.Core.FileSystem.Local.RelativeLocalFileSystem.AbsolutePath C# (CSharp) Метод

AbsolutePath() защищенный Метод

Gets the absolute path of the variable passed in
protected AbsolutePath ( string Path ) : string
Path string Path to convert to absolute
Результат string
        protected override string AbsolutePath(string Path)
        {
            Path = Path.Replace("/", "\\");
            string BaseDirectory = "";
            string ParentDirectory = "";
            if (HttpContext.Current == null)
            {
                BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
                ParentDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent.FullName;
            }
            else
            {
                BaseDirectory = HttpContext.Current.Server.MapPath("~/");
                ParentDirectory = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/")).Parent.FullName;
            }
            if (Path.StartsWith("..\\", StringComparison.Ordinal))
            {
                Path = ParentDirectory + Path.Right(Path.Length - 2);
            }
            else if (Path.StartsWith(".\\", StringComparison.Ordinal))
            {
                Path = BaseDirectory + Path.Right(Path.Length - 1);
            }
            else if (Path.StartsWith("~\\", StringComparison.Ordinal))
            {
                Path = BaseDirectory + Path.Right(Path.Length - 1);
            }
            return Path;
        }
RelativeLocalFileSystem