internal static void CreateOrClear(string dir) { var p = TempDirectory.ExtractPath(dir); if (Directory.Exists(p)) { TempDirectory.SafeDirectoryDelete(dir); } else { SessionState.DoCreateDirectory(p); } }