Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
S3Zip
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
scripts
S3Zip
Commits
0c998da5
Commit
0c998da5
authored
6 years ago
by
L. Ellenbeck
Browse files
Options
Downloads
Patches
Plain Diff
Better function to zip and upload a folder coscine/issues#83
parent
d89d2c30
No related branches found
No related tags found
1 merge request
!2
Product/75 s3 zip metadata
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/S3Zip.Tests/S3ZipTests.cs
+1
-7
1 addition, 7 deletions
src/S3Zip.Tests/S3ZipTests.cs
src/S3Zip/ZipUtilities.cs
+16
-1
16 additions, 1 deletion
src/S3Zip/ZipUtilities.cs
with
17 additions
and
8 deletions
src/S3Zip.Tests/S3ZipTests.cs
+
1
−
7
View file @
0c998da5
...
...
@@ -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
)]
...
...
This diff is collapsed.
Click to expand it.
src/S3Zip/ZipUtilities.cs
+
16
−
1
View file @
0c998da5
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment