enable to chose file type : .zip or .tar or .tar.gz#8
Open
pierreboutet wants to merge 2 commits intojenkinsci:masterfrom
Open
enable to chose file type : .zip or .tar or .tar.gz#8pierreboutet wants to merge 2 commits intojenkinsci:masterfrom
pierreboutet wants to merge 2 commits intojenkinsci:masterfrom
Conversation
Jmcfar
requested changes
Dec 19, 2017
| File zipFile = File.createTempFile(projectName + "-", ".zip"); | ||
| String extension; | ||
| BundleType bundleType; | ||
| if (fileType == null || fileType.equals("Tar")) { |
Collaborator
There was a problem hiding this comment.
This should be fileType.equals("Zip")
| } else if (fileType.equals("Tgz")) { | ||
| extension = ".tar.gz"; | ||
| bundleType = BundleType.Tgz; | ||
| } else { |
Collaborator
There was a problem hiding this comment.
I'd rather we throw on an unknown file type since you're already handling the default null case (maybe update it to include empty string too)
|
|
||
| sourceDirectory.zip( | ||
| new FileOutputStream(zipFile), | ||
| if (fileType == null || fileType.equals("Zip")) { |
Collaborator
There was a problem hiding this comment.
Might change this to switch based on bundleType since you set it earlier into 1 of the 3 categories (avoids having to have the fallback / null check here)
Collaborator
|
Hi! Thanks for the contribution. Did you perform any testing as part of the changes? If so it'd be helpful to include that in the PR. Are you OK with submitting this contribution under the Apache License 2.0? |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello,
this add a parameter to chose file type for the package (zip / tar / tar.gz)