-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] preserve original file's modification time when uploading to Grid #16935
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] preserve original file's modification time when uploading to Grid #16935
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
|
@asolntsev I think the review of |
02b17c5 to
b12d49d
Compare
b12d49d to
a41f728
Compare
I don't think it can be null. As much as I tried, it was never null - if not set, Zip treats entry modification time as "now". P.S. Merging this PR because only |
User description
🔗 Related Issues
Fixes #16927
💥 What does this PR do?
When uploading a file remotely, the uploaded file is packed to ZIP, and unpacked on the server side.
This PR fixes ZIP algorithm, so that it preserves the files' "lastModified" value when zipping/unzipping.
🔧 Implementation Notes
I touched only Java (tested myself) and JS (don't know how to test it).
Other bindings didn't have this problem (according to #16927).
🔄 Types of changes
PR Type
Bug fix
Description
Preserve file modification time when zipping/unzipping in Java and JavaScript
Add
FileTimehandling toZipEntryduring compression and decompressionUpdate tests to verify modification time preservation across zip operations
Diagram Walkthrough
File Walkthrough
Zip.java
Add FileTime preservation to zip/unzip operationsjava/src/org/openqa/selenium/io/Zip.java
FileTimefromjava.nio.file.attributepackagelastModifiedTimeonZipEntrywhen adding files to preserveoriginal modification time
ZipEntrywhen extracting filesduring unzip operation
zip.js
Preserve file modification time in JavaScript zipjavascript/selenium-webdriver/io/zip.js
fs/promisesmodule for file stat operationsaddFilemethod to retrieve file stats and preservemtimein zipoptions
dateparameter to jszip'sfile()method to maintain originalmodification time
ZipTest.java
Add modification time preservation testsjava/test/org/openqa/selenium/io/ZipTest.java
FileTimeand stream utilities for test assertionstestCanZipASingleFileassertion
writeTestZipto acceptlastModifiedStepparameter for variedtimestamps
writeTestZipEntryto setlastModifiedTimeonZipEntrywithcalculated values
testCanUnzipto verify multiple files preserve differentmodification times