1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Merge pull request #217 from DevCharly/jar-timestamp-fix

fixed timestamps in created JAR files (was 1970-01-01 00:00)
This commit is contained in:
Cedric Beust 2016-06-01 09:00:08 -07:00
commit a51ad75e7e

View file

@ -55,7 +55,7 @@ public class JarUtils {
if (!name.isEmpty()) {
if (!name.endsWith("/")) name += "/"
val entry = JarEntry(name)
entry.time = foundFile.lastModified()
entry.time = localFile.lastModified()
try {
outputStream.putNextEntry(entry)
} catch(ex: ZipException) {
@ -81,7 +81,7 @@ public class JarUtils {
} else {
val entryFileName = file.to(foundFile.path).path.replace("\\", "/")
val entry = JarEntry(entryFileName)
entry.time = foundFile.lastModified()
entry.time = localFile.lastModified()
addEntry(FileInputStream(localFile), entry, outputStream, onError)
}
}