This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Refactor, clean up ZipFile assembly#30364
Merged
ianhays merged 2 commits intodotnet:masterfrom Jun 14, 2018
ianhays:zipfile_cleanup
Merged
Refactor, clean up ZipFile assembly#30364ianhays merged 2 commits intodotnet:masterfrom ianhays:zipfile_cleanup
ianhays merged 2 commits intodotnet:masterfrom
ianhays:zipfile_cleanup
Conversation
This is a net-zero change PR to move around some files in the System.IO.Compression.ZipFile assembly in preparation for some upcoming major additions.
stephentoub
reviewed
Jun 13, 2018
| private static void DoCreateFromDirectory(string sourceDirectoryName, string destinationArchiveFileName, | ||
| CompressionLevel? compressionLevel, bool includeBaseDirectory, | ||
| Encoding entryNameEncoding) | ||
| CompressionLevel? compressionLevel, bool includeBaseDirectory, Encoding entryNameEncoding) |
stephentoub
reviewed
Jun 13, 2018
| /// | ||
| /// <param name="sourceArchiveFileName">The path to the archive on the file system that is to be extracted.</param> | ||
| /// <param name="destinationDirectoryName">The path to the directory on the file system. The directory specified must not exist, but the directory that it is contained in must exist.</param> | ||
| public static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName) => ExtractToDirectory(sourceArchiveFileName, destinationDirectoryName, entryNameEncoding: null, overwrite: false); |
Member
There was a problem hiding this comment.
Nit: These are long lines... maybe you could split them, at least moving this to the next line and indenting.
stephentoub
reviewed
Jun 13, 2018
| internal static ZipArchiveEntry DoCreateEntryFromFile(this ZipArchive destination, | ||
| string sourceFileName, string entryName, CompressionLevel? compressionLevel) | ||
| { | ||
| if (destination == null) |
Member
There was a problem hiding this comment.
Nit: indenting, here and the line above
stephentoub
approved these changes
Jun 13, 2018
Member
stephentoub
left a comment
There was a problem hiding this comment.
I only just skimmed it since you said there were zero actual code changes.
ViktorHofer
reviewed
Jun 13, 2018
| Assert.Equal(fileName, Path.GetFileName(results[0])); | ||
| } | ||
|
|
||
| #if netcoreapp |
Member
There was a problem hiding this comment.
nit: put that into its separate file: ZipFile.Extract.netcoreapp.cs?
ViktorHofer
reviewed
Jun 13, 2018
| /// <returns>A wrapper for the newly created entry.</returns> | ||
| public static ZipArchiveEntry CreateEntryFromFile(this ZipArchive destination, | ||
| string sourceFileName, string entryName, CompressionLevel compressionLevel) => | ||
| DoCreateEntryFromFile(destination, sourceFileName, entryName, compressionLevel); |
ViktorHofer
approved these changes
Jun 13, 2018
Member
|
@dotnet-bot test OSX x64 Debug Build please ("Error during cleanup: java.lang.IllegalArgumentException: Failed to prepare archiveArtifacts step") |
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
Refactor, clean up ZipFile assembly Commit migrated from dotnet/corefx@c6efb24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a net-zero change PR to move around some files in the System.IO.Compression.ZipFile assembly in preparation for some upcoming major additions.
src/ZipFileis split up into:src/ZipFileExtensionsis split up into:ZipFileConvenienceMethods,ZipFileConvenienceMethods.netcoreapp1.1,ZipFileInvalidFileTests, andZipFileReadOpenUpdateTestsare split up by their operating class and moved into:Note that this is not a comprehensive cleanup of the ZipFile classes/members themselves, but rather a clean up and reorganization of the files. My aim is not to make any code changes yet so that I can keep this PR simple.
PTAL: @stephentoub @ViktorHofer