properly (well, not really) handle uris

This commit is contained in:
Michael Becker 2019-12-20 07:32:48 -05:00
parent 3eadca0521
commit d2e15f2d34
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -128,6 +128,13 @@ namespace UniversalEditor.Accessors
}
protected override void OpenInternal()
{
string filename = mvarFileName;
if (filename.StartsWith("file://"))
{
Uri uri = new Uri(filename);
filename = uri.LocalPath;
}
System.IO.FileShare share = System.IO.FileShare.Read;
System.IO.FileMode mode = System.IO.FileMode.OpenOrCreate;
System.IO.FileAccess access = System.IO.FileAccess.Read;
@ -139,7 +146,7 @@ namespace UniversalEditor.Accessors
mode = System.IO.FileMode.Create;
}
}
mvarFileStream = System.IO.File.Open(mvarFileName, mode, access, share);
mvarFileStream = System.IO.File.Open(filename, mode, access, share);
}
protected override void CloseInternal()