1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -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.isEmpty()) {
if (!name.endsWith("/")) name += "/" if (!name.endsWith("/")) name += "/"
val entry = JarEntry(name) val entry = JarEntry(name)
entry.time = foundFile.lastModified() entry.time = localFile.lastModified()
try { try {
outputStream.putNextEntry(entry) outputStream.putNextEntry(entry)
} catch(ex: ZipException) { } catch(ex: ZipException) {
@ -81,7 +81,7 @@ public class JarUtils {
} else { } else {
val entryFileName = file.to(foundFile.path).path.replace("\\", "/") val entryFileName = file.to(foundFile.path).path.replace("\\", "/")
val entry = JarEntry(entryFileName) val entry = JarEntry(entryFileName)
entry.time = foundFile.lastModified() entry.time = localFile.lastModified()
addEntry(FileInputStream(localFile), entry, outputStream, onError) addEntry(FileInputStream(localFile), entry, outputStream, onError)
} }
} }