Skip to content

Commit 29f6842

Browse files
committed
FileSystemStorage - base folder
1 parent 2313741 commit 29f6842

File tree

7 files changed

+11
-17
lines changed

7 files changed

+11
-17
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<Product>Managed Code - Storage</Product>
16-
<Version>1.1.0</Version>
17-
<PackageVersion>1.1.0</PackageVersion>
16+
<Version>1.1.1</Version>
17+
<PackageVersion>1.1.1</PackageVersion>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
2020
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

ManagedCode.Storage.FileSystem/FileSystemStorage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class FileSystemStorage : IFileSystemStorage
1717

1818
public FileSystemStorage(FileSystemStorageOptions fileSystemStorageOptions)
1919
{
20-
_path = Path.Combine(fileSystemStorageOptions.CommonPath, fileSystemStorageOptions.Path);
20+
_path = fileSystemStorageOptions?.BaseFolder ?? Environment.CurrentDirectory;
2121
EnsureDirectoryExists();
2222
}
2323

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace ManagedCode.Storage.FileSystem.Options;
22

33
public class FileSystemStorageOptions
4-
{
5-
public string CommonPath { get; set; } = null!;
6-
public string Path { get; set; } = null!;
4+
{
5+
public string BaseFolder { get; set; } = null!;
76
}

ManagedCode.Storage.Tests/AspNetExtensions/StorageExtensionsTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public static ServiceProvider ConfigureServices()
3030

3131
services.AddFileSystemStorageAsDefault(opt =>
3232
{
33-
opt.CommonPath = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket");
34-
opt.Path = "managed-code-bucket";
33+
opt.BaseFolder = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket");
3534
});
3635

3736
return services.BuildServiceProvider();

ManagedCode.Storage.Tests/FileSystem/FileSystemTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ protected override ServiceProvider ConfigureServices()
1818

1919
services.AddFileSystemStorageAsDefault(opt =>
2020
{
21-
opt.CommonPath = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket");
22-
opt.Path = "managed-code-bucket";
21+
opt.BaseFolder = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket");
2322
});
2423

2524
services.AddFileSystemStorage(new FileSystemStorageOptions
2625
{
27-
CommonPath = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket"),
28-
Path = "managed-code-bucket"
26+
BaseFolder = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket")
2927
});
3028
return services.BuildServiceProvider();
3129
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![img|300x200](https://github.com/managed-code-hub/Storage/raw/main/logo.png)
1+
![img|300x200](https://raw.githubusercontent.com/managed-code-hub/Storage/main/logo.png)
22
# ManagedCode.Storage
33
[![.NET](https://github.com/managed-code-hub/Storage/actions/workflows/dotnet.yml/badge.svg)](https://github.com/managed-code-hub/Storage/actions/workflows/dotnet.yml)
44
[![Coverage Status](https://coveralls.io/repos/github/managed-code-hub/Storage/badge.svg?branch=main&service=github)](https://coveralls.io/github/managed-code-hub/Storage?branch=main)

Samples/WebApiSample/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616

1717
builder.Services.AddFileSystemStorageAsDefault(new FileSystemStorageOptions
1818
{
19-
CommonPath = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket"),
20-
Path = "managed-code-bucket"
19+
BaseFolder = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket"),
2120
});
2221

2322
builder.Services.AddFileSystemStorage(new FileSystemStorageOptions
2423
{
25-
CommonPath = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket"),
26-
Path = "managed-code-bucket"
24+
BaseFolder = Path.Combine(Environment.CurrentDirectory, "managed-code-bucket"),
2725
});
2826

2927
#endregion

0 commit comments

Comments
 (0)