Skip to content
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

Merged
merged 7 commits into from
Apr 22, 2022

Conversation

TamsilAmani
Copy link
Contributor

Description

Modified the installExtension() to send firefox addon directory as temporary in remote session.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2022

Codecov Report

Merging #10566 (27fe0a3) into trunk (bcbd009) will not change coverage.
The diff coverage is n/a.

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcbd009...27fe0a3. Read the comment docs.

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.*;
Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Member

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.

Copy link
Contributor Author

@TamsilAmani TamsilAmani Apr 21, 2022

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>() {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

@diemol diemol left a 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
Copy link

sonarcloud bot commented Apr 22, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants