Skip to content

Commit

Permalink
Merge pull request #2 from hkutluay/feature/core-upgrade
Browse files Browse the repository at this point in the history
Feature/core upgrade
  • Loading branch information
hkutluay committed Jan 2, 2021
2 parents e27d5c6 + 2c06c28 commit 2ef4428
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
dotnet-version: 5.0.x
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Unit Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
dotnet-version: 5.0.x
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Test with dotnet
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ PM> Install-Package ZipContent.S3
```

Sample usage:

```csharp
string bucket = "test";
string key = "foo.zip";

IAmazonS3 s3 = new AmazonS3Client();

IPartialFileReader partialReader = new S3PartialFileReader(s3, bucket, key);

IZipContentLister lister = new ZipContentLister(partialReader);

var contentList = await lister.GetContents();

foreach (var content in contentList)
Console.WriteLine(item.FullName);
```

Before 1.2.0 version:
```csharp
string bucket = "test";
string key = "foo.zip";
Expand Down
12 changes: 6 additions & 6 deletions ZipContent.S3.Test/GivenValidZipFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace ZipContent.S3.Test
[TestClass]
public class GivenValidZipFile
{
private readonly IZipContentLister _lister;


public GivenValidZipFile()
{
_lister = new ZipContentLister();

}

[TestMethod]
public async Task ExtractedFileCountShouldMatch()
{

var partialReader = new S3PartialFileReader(TestContext.GetAmazonS3Client(), "ZipFiles", "foo.zip");
var content = await _lister.GetContents(partialReader);
var lister = new ZipContentLister(partialReader);
var content = await lister.GetContents();
Assert.AreEqual(content.Count, 1);
}

Expand All @@ -28,8 +28,8 @@ public async Task ShouldHaveExpectedFileName()
{

var partialReader = new S3PartialFileReader(TestContext.GetAmazonS3Client(), "ZipFiles", "foo.zip");
var content = await _lister.GetContents(partialReader);

var lister = new ZipContentLister(partialReader);
var content = await lister.GetContents();
Assert.AreEqual(content[0].FullName, "foo.txt");
}
}
Expand Down
2 changes: 1 addition & 1 deletion ZipContent.S3.Test/ZipContent.S3.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions ZipContent.S3/ZipContent.S3.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.6;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>netstandard1.6;netstandard2.1;netstandard2.0;net5.0</TargetFrameworks>
<Description>S3PartialFileReader for ZipContent.Core

Lists zip file content on AWS S3 without downloading whole document. Supports both zip and zip64 files.</Description>
Expand All @@ -10,14 +10,14 @@ Lists zip file content on AWS S3 without downloading whole document. Supports bo
<RepositoryUrl>https://github.com/hkutluay/ZipContent</RepositoryUrl>
<PackageTags>zip list content AWS S3</PackageTags>
<PackageIcon>s3_logo.png</PackageIcon>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<Version>1.2.0</Version>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.110.71" />
<PackageReference Include="ZipContent.Core" Version="1.1.1" />
<PackageReference Include="ZipContent.Core" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 2ef4428

Please sign in to comment.