From b78ceea35fd0c2ba9c668dc0487db086eb3f0827 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 12 Dec 2024 12:01:29 +0100 Subject: [PATCH] Cleanup DefaultOciLayerTask --- .../github/sgtsilvio/gradle/oci/layer/DefaultOciLayerTask.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/layer/DefaultOciLayerTask.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/layer/DefaultOciLayerTask.kt index 2262e4d7..ab7a00b2 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/layer/DefaultOciLayerTask.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/layer/DefaultOciLayerTask.kt @@ -7,6 +7,7 @@ import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream import org.gradle.api.Action import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Nested +import java.nio.file.attribute.FileTime abstract class DefaultOciLayerTask : OciLayerTask() { @@ -27,7 +28,7 @@ abstract class DefaultOciLayerTask : OciLayerTask() { setPermissions(fileMetadata.permissions) setUserId(fileMetadata.userId) setGroupId(fileMetadata.groupId) - setModTime(fileMetadata.modificationTime.toEpochMilli()) + lastModifiedTime = FileTime.from(fileMetadata.modificationTime) size = fileMetadata.size }) fileSource.copyTo(tos) @@ -39,7 +40,7 @@ abstract class DefaultOciLayerTask : OciLayerTask() { setPermissions(fileMetadata.permissions) setUserId(fileMetadata.userId) setGroupId(fileMetadata.groupId) - setModTime(fileMetadata.modificationTime.toEpochMilli()) + lastModifiedTime = FileTime.from(fileMetadata.modificationTime) }) tos.closeArchiveEntry() }