symious commented on code in PR #10117:
URL: https://github.com/apache/ozone/pull/10117#discussion_r3135693658
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/Archiver.java:
##########
@@ -105,7 +106,20 @@ public static void includePath(Path dir, String subdir,
public static long includeFile(File file, String entryName,
ArchiveOutputStream<TarArchiveEntry> archiveOutput) throws IOException {
final long bytes;
- TarArchiveEntry entry = archiveOutput.createArchiveEntry(file, entryName);
+
+ TarArchiveEntry entry = new TarArchiveEntry(entryName);
+ entry.setMode(TarArchiveEntry.DEFAULT_FILE_MODE);
+ try {
+ BasicFileAttributes attrs = Files.readAttributes(
+ file.toPath(), BasicFileAttributes.class);
+ entry.setLastModifiedTime(attrs.lastModifiedTime());
+ entry.setLastAccessTime(attrs.lastAccessTime());
+ entry.setCreationTime(attrs.creationTime());
+ } catch (IOException e) {
+ entry.setModTime(file.lastModified()); // fallback
+ }
+ entry.setSize(file.length());
Review Comment:
@adoroszlai Thank you for the review. Updated, PTAL.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]