-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
74642 change isostorage path (#75541)
* #74642 changed isolated storage path for mobile platforms
- Loading branch information
Showing
13 changed files
with
140 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.AnyMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
internal static partial class Helper | ||
{ | ||
public const string IsolatedStorageDirectoryName = ".isolated-storage"; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.NonMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
internal static partial class Helper | ||
{ | ||
public const string IsolatedStorageDirectoryName = "IsolatedStorage"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.AnyMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable | ||
{ | ||
private string GetIsolatedStorageRoot() | ||
{ | ||
return Helper.GetRootDirectory(Scope); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.NonMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Text; | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
public sealed partial class IsolatedStorageFile : IsolatedStorage, IDisposable | ||
{ | ||
private string GetIsolatedStorageRoot() | ||
{ | ||
StringBuilder root = new StringBuilder(Helper.GetRootDirectory(Scope)); | ||
root.Append(SeparatorExternal); | ||
root.Append(IdentityHash); | ||
|
||
return root.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...braries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.AnyMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Reflection; | ||
using System.Collections.Generic; | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
public static partial class TestHelper | ||
{ | ||
private static List<string> GetRoots() | ||
{ | ||
List<string> roots = new List<string>(); | ||
string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); | ||
string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); | ||
roots.Add(randomUserRoot); | ||
|
||
// Application scope doesn't go under a random dir | ||
roots.Add(userRoot); | ||
return roots; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...braries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/TestHelper.NonMobile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Reflection; | ||
using System.Collections.Generic; | ||
|
||
namespace System.IO.IsolatedStorage | ||
{ | ||
public static partial class TestHelper | ||
{ | ||
private static List<string> GetRoots() | ||
{ | ||
string hash; | ||
object identity; | ||
Helper.GetDefaultIdentityAndHash(out identity, out hash, '.'); | ||
List<string> roots = new List<string>(); | ||
string userRoot = Helper.GetDataDirectory(IsolatedStorageScope.User); | ||
string randomUserRoot = Helper.GetRandomDirectory(userRoot, IsolatedStorageScope.User); | ||
|
||
roots.Add(Path.Combine(randomUserRoot, hash)); | ||
// Application scope doesn't go under a random dir | ||
roots.Add(Path.Combine(userRoot, hash)); | ||
|
||
// https://github.com/dotnet/runtime/issues/2092 | ||
// https://github.com/dotnet/runtime/issues/21742 | ||
if (OperatingSystem.IsWindows() | ||
&& !PlatformDetection.IsInAppContainer) | ||
{ | ||
roots.Add(Helper.GetDataDirectory(IsolatedStorageScope.Machine)); | ||
} | ||
|
||
return roots; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters