-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Support for sending firefox addon directory as temporary in remote sessions #10566
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #10566 +/- ##
=======================================
Coverage 45.02% 45.02%
=======================================
Files 85 85
Lines 5508 5508
Branches 268 268
=======================================
Hits 2480 2480
Misses 2760 2760
Partials 268 268 Continue to review full report at Codecov.
|
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IntelliJ tends to do this by default when optimizing imports. But it is good practice to avoid importing entire package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll correct that.
return FileVisitResult.CONTINUE; | ||
} | ||
}); | ||
zos.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be done in a Try with Resources block?
Maybe we can extract those lines for the unzipping into another method so it looks more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated the changes. Please check to verify and resolve :)
if (Files.isDirectory(path)) { | ||
Path extZip = Paths.get(path.getFileName().toString()+".zip"); | ||
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(extZip.toFile())); | ||
Files.walkFileTree(path, new SimpleFileVisitor<Path>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be fine if Path is not passed explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing Path
is breaking the code. I'll look into it further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you @TamsilAmani!
SonarCloud Quality Gate failed. |
Description
Modified the
installExtension()
to send firefox addon directory as temporary in remote session.Motivation and Context
Types of changes
Checklist