symious commented on code in PR #10117:
URL: https://github.com/apache/ozone/pull/10117#discussion_r3135834735
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/Archiver.java:
##########
@@ -79,12 +80,29 @@ public static byte[] readEntry(InputStream input, final
long size)
return output.toByteArray();
}
+ private static TarArchiveEntry createBasicTarArchiveEntry(File file, String
entryName)
+ throws IOException {
+ 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:
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]