Skip to content

Commit 848287e

Browse files
committed
Fixed file references after previous commit rename
Improved path using
1 parent 91b04c4 commit 848287e

File tree

8 files changed

+89
-80
lines changed

8 files changed

+89
-80
lines changed

src/PCLExt.FileStorage.Android/PCLExt.FileStorage.Android.csproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,52 +48,52 @@
4848
<Compile Include="..\PCLExt.FileStorage.NetFX\DefaultFolderImplementation.cs">
4949
<Link>DefaultFolderImplementation.cs</Link>
5050
</Compile>
51-
<Compile Include="..\pclext.filestorage.portable\exceptions\ExceptionsHelper.cs">
51+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\ExceptionsHelper.cs">
5252
<Link>Exceptions\ExceptionsHelper.cs</Link>
5353
</Compile>
54-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FileExistException.cs">
54+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileExistException.cs">
5555
<Link>Exceptions\FileExistException.cs</Link>
5656
</Compile>
57-
<Compile Include="..\pclext.filestorage.portable\exceptions\FileNotFoundException.cs">
57+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileNotFoundException.cs">
5858
<Link>Exceptions\FileNotFoundException.cs</Link>
5959
</Compile>
60-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderExistException.cs">
60+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderExistException.cs">
6161
<Link>Exceptions\FolderExistException.cs</Link>
6262
</Compile>
63-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderNotFoundException.cs">
63+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderNotFoundException.cs">
6464
<Link>Exceptions\FolderNotFoundException.cs</Link>
6565
</Compile>
66-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\RootFolderDeletionException.cs">
66+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\RootFolderDeletionException.cs">
6767
<Link>Exceptions\RootFolderDeletionException.cs</Link>
6868
</Compile>
69-
<Compile Include="..\pclext.filestorage.portable\extensions\AwaitExtensions.cs">
69+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\AwaitExtensions.cs">
7070
<Link>Extensions\AwaitExtensions.cs</Link>
7171
</Compile>
72-
<Compile Include="..\pclext.filestorage.portable\extensions\FileExtensions.cs">
72+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FileExtensions.cs">
7373
<Link>Extensions\FileExtensions.cs</Link>
7474
</Compile>
75-
<Compile Include="..\pclext.filestorage.portable\extensions\FolderExtensions.cs">
75+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FolderExtensions.cs">
7676
<Link>Extensions\FolderExtensions.cs</Link>
7777
</Compile>
78-
<Compile Include="..\pclext.filestorage.portable\files\FileFromPath.cs">
78+
<Compile Include="..\PCLExt.FileStorage.Portable111\Files\FileFromPath.cs">
7979
<Link>Files\FileFromPath.cs</Link>
8080
</Compile>
81-
<Compile Include="..\pclext.filestorage.portable\folders\ApplicationFolder.cs">
81+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\ApplicationFolder.cs">
8282
<Link>Folders\ApplicationFolder.cs</Link>
8383
</Compile>
84-
<Compile Include="..\pclext.filestorage.portable\folders\FolderFromPath.cs">
84+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\FolderFromPath.cs">
8585
<Link>Folders\FolderFromPath.cs</Link>
8686
</Compile>
87-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\LocalStorageFolder.cs">
87+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\LocalStorageFolder.cs">
8888
<Link>Folders\LocalStorageFolder.cs</Link>
8989
</Compile>
90-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\RoamingStorageFolder.cs">
90+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\RoamingStorageFolder.cs">
9191
<Link>Folders\RoamingStorageFolder.cs</Link>
9292
</Compile>
93-
<Compile Include="..\PCLExt.FileStorage.Portable\PortablePath.cs">
93+
<Compile Include="..\PCLExt.FileStorage.Portable111\PortablePath.cs">
9494
<Link>PortablePath.cs</Link>
9595
</Compile>
96-
<Compile Include="..\PCLExt.FileStorage.Portable\Requires.cs">
96+
<Compile Include="..\PCLExt.FileStorage.Portable111\Requires.cs">
9797
<Link>Requires.cs</Link>
9898
</Compile>
9999
<Compile Include="Properties\AssemblyInfo.cs" />

src/PCLExt.FileStorage.Core/PCLExt.FileStorage.Core.csproj

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@
2121
<Compile Include="..\..\common\CommonAssemblyInfo.cs" Link="Properties\CommonAssemblyInfo.cs" />
2222
<Compile Include="..\PCLExt.FileStorage.NetFX\DefaultFileImplementation.cs" Link="DefaultFileImplementation.cs" />
2323
<Compile Include="..\PCLExt.FileStorage.NetFX\DefaultFolderImplementation.cs" Link="DefaultFolderImplementation.cs" />
24-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\ExceptionsHelper.cs" Link="Exceptions\ExceptionsHelper.cs" />
25-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FileExistException.cs" Link="Exceptions\FileExistException.cs" />
26-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FileNotFoundException.cs" Link="Exceptions\FileNotFoundException.cs" />
27-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderExistException.cs" Link="Exceptions\FolderExistException.cs" />
28-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderNotFoundException.cs" Link="Exceptions\FolderNotFoundException.cs" />
29-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\RootFolderDeletionException.cs" Link="Exceptions\RootFolderDeletionException.cs" />
30-
<Compile Include="..\PCLExt.FileStorage.Portable\Extensions\AwaitExtensions.cs" Link="Extensions\AwaitExtensions.cs" />
31-
<Compile Include="..\PCLExt.FileStorage.Portable\Extensions\FileExtensions.cs" Link="Extensions\FileExtensions.cs" />
32-
<Compile Include="..\PCLExt.FileStorage.Portable\Extensions\FolderExtensions.cs" Link="Extensions\FolderExtensions.cs" />
33-
<Compile Include="..\PCLExt.FileStorage.Portable\Files\FileFromPath.cs" Link="Files\FileFromPath.cs" />
34-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\ApplicationFolder.cs" Link="Folders\ApplicationFolder.cs" />
35-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\FolderFromPath.cs" Link="Folders\FolderFromPath.cs" />
36-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\LocalStorageFolder.cs" Link="Folders\LocalStorageFolder.cs" />
37-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\RoamingStorageFolder.cs" Link="Folders\RoamingStorageFolder.cs" />
38-
<Compile Include="..\PCLExt.FileStorage.Portable\Requires.cs" Link="Requires.cs" />
24+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\ExceptionsHelper.cs" Link="Exceptions\ExceptionsHelper.cs" />
25+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileExistException.cs" Link="Exceptions\FileExistException.cs" />
26+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileNotFoundException.cs" Link="Exceptions\FileNotFoundException.cs" />
27+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderExistException.cs" Link="Exceptions\FolderExistException.cs" />
28+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderNotFoundException.cs" Link="Exceptions\FolderNotFoundException.cs" />
29+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\RootFolderDeletionException.cs" Link="Exceptions\RootFolderDeletionException.cs" />
30+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\AwaitExtensions.cs" Link="Extensions\AwaitExtensions.cs" />
31+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FileExtensions.cs" Link="Extensions\FileExtensions.cs" />
32+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FolderExtensions.cs" Link="Extensions\FolderExtensions.cs" />
33+
<Compile Include="..\PCLExt.FileStorage.Portable111\Files\FileFromPath.cs" Link="Files\FileFromPath.cs" />
34+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\ApplicationFolder.cs" Link="Folders\ApplicationFolder.cs" />
35+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\FolderFromPath.cs" Link="Folders\FolderFromPath.cs" />
36+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\LocalStorageFolder.cs" Link="Folders\LocalStorageFolder.cs" />
37+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\RoamingStorageFolder.cs" Link="Folders\RoamingStorageFolder.cs" />
38+
<Compile Include="..\PCLExt.FileStorage.Portable111\PortablePath.cs" Link="PortablePath.cs" />
39+
<Compile Include="..\PCLExt.FileStorage.Portable111\Requires.cs" Link="Requires.cs" />
3940
</ItemGroup>
4041

4142
<ItemGroup>

src/PCLExt.FileStorage.NetFX.Test/FilesTest.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.IO;
33

44
using PCLExt.FileStorage.Exceptions;
5-
5+
using PCLExt.FileStorage.Extensions;
66
#if NUNIT
77

88
using NUnit.Framework;
@@ -534,5 +534,13 @@ public void MoveUnknown()
534534
}
535535

536536
#endregion
537+
538+
[TestMethod]
539+
public void FileFromPath()
540+
{
541+
var file = new TestFolder().GetFileFromPath(Path.Combine("Folder1", FileName2));
542+
Assert.IsTrue(file.Exists);
543+
Assert.IsTrue(file.Path == Path.Combine(new TestFolder().Path, "Folder1", FileName2));
544+
}
537545
}
538546
}

src/PCLExt.FileStorage.NetFX.Test/FoldersTest.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.IO;
33

44
using PCLExt.FileStorage.Exceptions;
5-
5+
using PCLExt.FileStorage.Extensions;
66
#if NUNIT
77

88
using NUnit.Framework;
@@ -648,5 +648,13 @@ public void MoveSelfFailIfExists()
648648
}
649649

650650
#endregion
651+
652+
[TestMethod]
653+
public void FolderFromPath()
654+
{
655+
var folder = new TestFolder().GetFolderFromPath(Path.Combine(FolderName1, FolderName2));
656+
Assert.IsTrue(folder.Exists);
657+
Assert.IsTrue(folder.Path == Path.Combine(new TestFolder().Path, FolderName1, FolderName2));
658+
}
651659
}
652660
}

src/PCLExt.FileStorage.NetFX/PCLExt.FileStorage.NetFX.csproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,52 +38,52 @@
3838
<Compile Include="..\..\common\CommonAssemblyInfo.cs">
3939
<Link>Properties\CommonAssemblyInfo.cs</Link>
4040
</Compile>
41-
<Compile Include="..\pclext.filestorage.portable\exceptions\ExceptionsHelper.cs">
41+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\ExceptionsHelper.cs">
4242
<Link>Exceptions\ExceptionsHelper.cs</Link>
4343
</Compile>
44-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FileExistException.cs">
44+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileExistException.cs">
4545
<Link>Exceptions\FileExistException.cs</Link>
4646
</Compile>
47-
<Compile Include="..\pclext.filestorage.portable\exceptions\FileNotFoundException.cs">
47+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FileNotFoundException.cs">
4848
<Link>Exceptions\FileNotFoundException.cs</Link>
4949
</Compile>
50-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderExistException.cs">
50+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderExistException.cs">
5151
<Link>Exceptions\FolderExistException.cs</Link>
5252
</Compile>
53-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\FolderNotFoundException.cs">
53+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\FolderNotFoundException.cs">
5454
<Link>Exceptions\FolderNotFoundException.cs</Link>
5555
</Compile>
56-
<Compile Include="..\PCLExt.FileStorage.Portable\Exceptions\RootFolderDeletionException.cs">
56+
<Compile Include="..\PCLExt.FileStorage.Portable111\Exceptions\RootFolderDeletionException.cs">
5757
<Link>Exceptions\RootFolderDeletionException.cs</Link>
5858
</Compile>
59-
<Compile Include="..\pclext.filestorage.portable\extensions\AwaitExtensions.cs">
59+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\AwaitExtensions.cs">
6060
<Link>Extensions\AwaitExtensions.cs</Link>
6161
</Compile>
62-
<Compile Include="..\pclext.filestorage.portable\extensions\FileExtensions.cs">
62+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FileExtensions.cs">
6363
<Link>Extensions\FileExtensions.cs</Link>
6464
</Compile>
65-
<Compile Include="..\pclext.filestorage.portable\extensions\FolderExtensions.cs">
65+
<Compile Include="..\PCLExt.FileStorage.Portable111\Extensions\FolderExtensions.cs">
6666
<Link>Extensions\FolderExtensions.cs</Link>
6767
</Compile>
68-
<Compile Include="..\pclext.filestorage.portable\files\FileFromPath.cs">
68+
<Compile Include="..\PCLExt.FileStorage.Portable111\Files\FileFromPath.cs">
6969
<Link>Files\FileFromPath.cs</Link>
7070
</Compile>
71-
<Compile Include="..\pclext.filestorage.portable\folders\ApplicationFolder.cs">
71+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\ApplicationFolder.cs">
7272
<Link>Folders\ApplicationFolder.cs</Link>
7373
</Compile>
74-
<Compile Include="..\pclext.filestorage.portable\folders\FolderFromPath.cs">
74+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\FolderFromPath.cs">
7575
<Link>Folders\FolderFromPath.cs</Link>
7676
</Compile>
77-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\LocalStorageFolder.cs">
77+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\LocalStorageFolder.cs">
7878
<Link>Folders\LocalStorageFolder.cs</Link>
7979
</Compile>
80-
<Compile Include="..\PCLExt.FileStorage.Portable\Folders\RoamingStorageFolder.cs">
80+
<Compile Include="..\PCLExt.FileStorage.Portable111\Folders\RoamingStorageFolder.cs">
8181
<Link>Folders\RoamingStorageFolder.cs</Link>
8282
</Compile>
83-
<Compile Include="..\PCLExt.FileStorage.Portable\PortablePath.cs">
83+
<Compile Include="..\PCLExt.FileStorage.Portable111\PortablePath.cs">
8484
<Link>PortablePath.cs</Link>
8585
</Compile>
86-
<Compile Include="..\PCLExt.FileStorage.Portable\Requires.cs">
86+
<Compile Include="..\PCLExt.FileStorage.Portable111\Requires.cs">
8787
<Link>Requires.cs</Link>
8888
</Compile>
8989
<Compile Include="DefaultFileImplementation.cs" />

src/PCLExt.FileStorage.Portable111/Extensions/FolderExtensions.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ public static IFolder GetFolderFromPath(this IFolder folder, string folderPath)
1919
{
2020
var folders = folderPath.Split(new[]
2121
{
22-
#if DESKTOP || ANDROID || __IOS__ || MAC || PORTABLE
2322
PortablePath.DirectorySeparatorChar
24-
#elif NETSTANDARD2_0
25-
System.IO.Path.DirectorySeparatorChar
26-
#endif
2723
}, StringSplitOptions.RemoveEmptyEntries);
2824

2925
return GetFolderFromPath(folder, folders);
@@ -55,11 +51,7 @@ public static IFile GetFileFromPath(this IFolder folder, string filePath)
5551
{
5652
var foldersWithFile = filePath.Split(new[]
5753
{
58-
#if DESKTOP || ANDROID || __IOS__ || MAC || PORTABLE
5954
PortablePath.DirectorySeparatorChar
60-
#elif NETSTANDARD2_0
61-
System.IO.Path.DirectorySeparatorChar
62-
#endif
6355
}, StringSplitOptions.RemoveEmptyEntries);
6456

6557
return GetFileFromPath(folder, foldersWithFile);

src/PCLExt.FileStorage.Portable111/PortablePath.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static char DirectorySeparatorChar
2323
{
2424
get
2525
{
26-
#if DESKTOP || MAC || ANDROID || __IOS__
26+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
2727
return System.IO.Path.DirectorySeparatorChar;
2828
#endif
2929

@@ -38,11 +38,11 @@ public static char DirectorySeparatorChar
3838
/// <returns>A combined path.</returns>
3939
public static string Combine(params string[] paths)
4040
{
41-
#if DESKTOP || MAC || ANDROID || __IOS__
41+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
4242
return System.IO.Path.Combine(paths);
4343
#endif
4444

45-
throw ExceptionsHelper.NotImplementedInReferenceAssembly();
45+
throw ExceptionsHelper.NotImplementedInReferenceAssembly();
4646
}
4747

4848
/// <summary>
@@ -58,7 +58,7 @@ public static string Combine(params string[] paths)
5858
/// <exception cref="System.ArgumentException"><paramref name="path" /> contains one or more invalid characters.</exception>
5959
public static string GetExtension(string path)
6060
{
61-
#if DESKTOP || MAC || ANDROID || __IOS__
61+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
6262
return System.IO.Path.GetExtension(path);
6363
#endif
6464

@@ -82,7 +82,7 @@ public static string GetExtension(string path)
8282
/// <exception cref="System.ArgumentException"><paramref name="path" /> contains one or more invalid characters.</exception>
8383
public static string GetFileName(string path)
8484
{
85-
#if DESKTOP || MAC || ANDROID || __IOS__
85+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
8686
return System.IO.Path.GetFileName(path);
8787
#endif
8888

@@ -101,7 +101,7 @@ public static string GetFileName(string path)
101101
/// <exception cref="System.ArgumentException"><paramref name="path" /> contains one or more invalid characters.</exception>
102102
public static string GetFileNameWithoutExtension(string path)
103103
{
104-
#if DESKTOP || MAC || ANDROID || __IOS__
104+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
105105
return System.IO.Path.GetFileNameWithoutExtension(path);
106106
#endif
107107

@@ -121,7 +121,7 @@ public static string GetFileNameWithoutExtension(string path)
121121
/// <exception cref="System.ArgumentException"><paramref name="path" /> contains one or more invalid characters.</exception>
122122
public static bool HasExtension(string path)
123123
{
124-
#if DESKTOP || MAC || ANDROID || __IOS__
124+
#if NETSTANDARD2_0 || DESKTOP || MAC || ANDROID || __IOS__
125125
return System.IO.Path.HasExtension(path);
126126
#endif
127127

0 commit comments

Comments
 (0)