static string GetAppBase (string appBase)
{
if (appBase == null)
return null;
int len = appBase.Length;
if (len >= 8 && appBase.ToLower ().StartsWith ("file://")) {
appBase = appBase.Substring (7);
if (Path.DirectorySeparatorChar != '/')
appBase = appBase.Replace ('/', Path.DirectorySeparatorChar);
if (Environment.IsRunningOnWindows) {
// Under Windows prepend "//" to indicate it's a local file
appBase = "//" + appBase;
}
} else {
appBase = Path.GetFullPath (appBase);
}
return appBase;
}