Skip to content

Commit 542266c

Browse files
committed
update packages
1 parent 5176404 commit 542266c

File tree

11 files changed

+50
-45
lines changed

11 files changed

+50
-45
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ NuGet/
55
Test/
66
TestConsoleApp/
77
TestWebApp/
8-
.DS_Store
8+
.DS_Store
9+
*.DotSettings.user

FileSystem.Adapters.AmazonS3/FileSystem.Adapters.AmazonS3.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="AWSSDK.S3" Version="3.3.110.68"/>
30+
<PackageReference Include="AWSSDK.S3" Version="3.7.7.16"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>

FileSystem.Adapters.AzureBlobStorage/FileSystem.Adapters.AzureBlobStorage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Azure.Storage.Blobs" Version="12.4.2"/>
30+
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>

FileSystem.Adapters.AzureFileStorage/FileSystem.Adapters.AzureFileStorage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.2.1"/>
30+
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.8.0"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>

FileSystem.Adapters.Dropbox/FileSystem.Adapters.Dropbox.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Dropbox.Api" Version="4.10.0"/>
30+
<PackageReference Include="Dropbox.Api" Version="6.22.0"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>

FileSystem.Adapters.MicrosoftOneDrive/FileSystem.Adapters.MicrosoftOneDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Microsoft.Graph" Version="3.8.0"/>
31-
<PackageReference Include="Microsoft.Identity.Client" Version="4.15.0"/>
30+
<PackageReference Include="Microsoft.Graph" Version="4.17.0"/>
31+
<PackageReference Include="Microsoft.Identity.Client" Version="4.40.0"/>
3232
</ItemGroup>
3333

3434
<ItemGroup>

FileSystem.Adapters.MicrosoftOneDrive/src/MicrosoftOneDriveAdapter.cs

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -290,22 +290,20 @@ public override async Task WriteFileAsync(string path, byte[] contents, bool ove
290290
try
291291
{
292292
using var memoryStream = new MemoryStream(contents);
293-
var uploadSession = await client.Drives[driveId].Root.ItemWithPath(path).CreateUploadSession().Request()
294-
.PostAsync(cancellationToken);
295-
var provider = new ChunkedUploadProvider(uploadSession, client, memoryStream);
296-
var chunkRequests = provider.GetUploadChunkRequests();
297-
var exceptionTrackingList = new List<Exception>();
293+
var uploadSession = await client.Drives[driveId].Root.ItemWithPath(path).CreateUploadSession().Request().PostAsync(cancellationToken);
294+
var largeFileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, memoryStream);
298295

299-
foreach (var request in chunkRequests)
300-
{
301-
var result = await provider.GetChunkRequestResponseAsync(request, exceptionTrackingList);
296+
var result = await largeFileUploadTask.UploadAsync();
302297

303-
if (!result.UploadSucceeded && exceptionTrackingList.Any())
304-
{
305-
throw new AdapterRuntimeException(exceptionTrackingList.First());
306-
}
298+
if (!result.UploadSucceeded)
299+
{
300+
throw new AdapterRuntimeException();
307301
}
308302
}
303+
catch (TaskCanceledException exception) when (exception.InnerException != null)
304+
{
305+
throw Exception(exception.InnerException);
306+
}
309307
catch (Exception exception)
310308
{
311309
throw Exception(exception);
@@ -324,23 +322,20 @@ public override async Task AppendFileAsync(string path, byte[] contents, Cancell
324322
try
325323
{
326324
using var memoryStream = new MemoryStream(contents);
327-
var uploadSession = await client.Drives[driveId].Root.ItemWithPath(path).CreateUploadSession().Request()
328-
.PostAsync(cancellationToken);
329-
var provider = new ChunkedUploadProvider(uploadSession, client, memoryStream);
325+
var uploadSession = await client.Drives[driveId].Root.ItemWithPath(path).CreateUploadSession().Request().PostAsync(cancellationToken);
326+
var largeFileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, memoryStream);
330327

331-
var chunkRequests = provider.GetUploadChunkRequests();
332-
var exceptionTrackingList = new List<Exception>();
328+
var result = await largeFileUploadTask.UploadAsync();
333329

334-
foreach (var request in chunkRequests)
330+
if (!result.UploadSucceeded)
335331
{
336-
var result = await provider.GetChunkRequestResponseAsync(request, exceptionTrackingList);
337-
338-
if (!result.UploadSucceeded && exceptionTrackingList.Any())
339-
{
340-
throw new AdapterRuntimeException(exceptionTrackingList.First());
341-
}
332+
throw new AdapterRuntimeException();
342333
}
343334
}
335+
catch (TaskCanceledException exception) when (exception.InnerException != null)
336+
{
337+
throw Exception(exception.InnerException);
338+
}
344339
catch (Exception exception)
345340
{
346341
throw Exception(exception);

FileSystem.Adapters.Sftp/FileSystem.Adapters.Sftp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="SSH.NET" Version="2016.1.0"/>
30+
<PackageReference Include="SSH.NET" Version="2020.0.1"/>
3131
</ItemGroup>
3232

3333
<ItemGroup>

FileSystem.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileSystem.Adapters.Sftp",
1616
EndProject
1717
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{F18C90D8-F1A2-419E-B3CD-C9B7965583A3}"
1818
EndProject
19-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestConsoleApp", "TestConsoleApp\TestConsoleApp.csproj", "{808D9778-452F-4FF9-B3B0-62BD12CE855F}"
20-
EndProject
2119
Global
2220
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2321
Debug|Any CPU = Debug|Any CPU
@@ -56,9 +54,5 @@ Global
5654
{F18C90D8-F1A2-419E-B3CD-C9B7965583A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
5755
{F18C90D8-F1A2-419E-B3CD-C9B7965583A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
5856
{F18C90D8-F1A2-419E-B3CD-C9B7965583A3}.Release|Any CPU.Build.0 = Release|Any CPU
59-
{808D9778-452F-4FF9-B3B0-62BD12CE855F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60-
{808D9778-452F-4FF9-B3B0-62BD12CE855F}.Debug|Any CPU.Build.0 = Debug|Any CPU
61-
{808D9778-452F-4FF9-B3B0-62BD12CE855F}.Release|Any CPU.ActiveCfg = Release|Any CPU
62-
{808D9778-452F-4FF9-B3B0-62BD12CE855F}.Release|Any CPU.Build.0 = Release|Any CPU
6357
EndGlobalSection
6458
EndGlobal

FileSystem/src/Exceptions/AdapterRuntimeException.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ namespace SharpGrip.FileSystem.Exceptions
44
{
55
public class AdapterRuntimeException : FileSystemException
66
{
7-
public AdapterRuntimeException(Exception innerException) : base(GetMessage(), innerException)
7+
public AdapterRuntimeException() : base(GetMessage(null))
88
{
99
}
1010

11-
private static string GetMessage()
11+
public AdapterRuntimeException(Exception innerException) : base(GetMessage(innerException), innerException)
1212
{
13-
return "An adapter runtime exception occured. See the inner exception for more details.";
13+
}
14+
15+
private static string GetMessage(Exception? innerException)
16+
{
17+
if (innerException != null)
18+
{
19+
return "An adapter runtime exception occured. See the inner exception for more details.";
20+
}
21+
22+
return "An adapter runtime exception occured.";
1423
}
1524
}
1625
}

Tests/Tests.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1"/>
10-
<PackageReference Include="Moq" Version="4.14.1"/>
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
10+
<PackageReference Include="Moq" Version="4.16.1"/>
1111
<PackageReference Include="xunit" Version="2.4.1"/>
12-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"/>
13-
<PackageReference Include="coverlet.collector" Version="1.2.1"/>
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
13+
<PrivateAssets>all</PrivateAssets>
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
</PackageReference>
16+
<PackageReference Include="coverlet.collector" Version="3.1.0">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1420
</ItemGroup>
1521

1622
<ItemGroup>

0 commit comments

Comments
 (0)