Skip to content
Snippets Groups Projects
Commit 0c998da5 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Better function to zip and upload a folder coscine/issues#83

parent d89d2c30
No related branches found
No related tags found
1 merge request!2Product/75 s3 zip metadata
......@@ -54,13 +54,7 @@ namespace Coscine.S3Zip.Tests
var key = "test.zip";
var zipUtilities = new ZipUtilities(_s3MultipartStreamConfiguration);
using (var s3MultipartDownloadStream = new S3MultipartDownloadStream(key, _s3MultipartStreamConfiguration))
{
using (var archive = new ZipArchive(s3MultipartDownloadStream, ZipArchiveMode.Read))
{
zipUtilities.UnzipToFolder(archive, @"c:\temp\test2\");
}
}
zipUtilities.DownloadAndUnzipToFolder(key, @"c:\temp\test2\");
}
[TestCase(110, 50)]
......
......@@ -71,6 +71,21 @@ namespace Coscine.S3Zip
}
}
}
public void DownloadAndUnzipToFolder(string key, string path)
{
DownloadAndUnzipToFolder(key, new DirectoryInfo(path));
}
public void DownloadAndUnzipToFolder(string key, DirectoryInfo directoryInfo)
{
using (var s3MultipartDownloadStream = new S3MultipartDownloadStream(key, S3ZipConfiguration))
{
using (var archive = new ZipArchive(s3MultipartDownloadStream, ZipArchiveMode.Read))
{
UnzipToFolder(archive, directoryInfo);
}
}
}
public void UnzipToFolder(ZipArchive archive, string path)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment