Mercurial > cgi-bin > hgweb.cgi > JpegWasher
comparison src/name/blackcap/exifwasher/exiv2/Initialize.kt @ 1:42277ce58ace
Improve exception handling; always use absolute paths on libs.
author | David Barts <n5jrn@me.com> |
---|---|
date | Tue, 31 Mar 2020 15:38:25 -0700 |
parents | db63d01a23c6 |
children | efd9fe2d70d7 |
comparison
equal
deleted
inserted
replaced
0:db63d01a23c6 | 1:42277ce58ace |
---|---|
43 val source = myJar.getJarEntry(sPath) | 43 val source = myJar.getJarEntry(sPath) |
44 if (source == null) { | 44 if (source == null) { |
45 die("${sPath} not found in jar") | 45 die("${sPath} not found in jar") |
46 } | 46 } |
47 val target = File(LF_DIR, eBase) | 47 val target = File(LF_DIR, eBase) |
48 val tPath = target.toString() | 48 val tPath = target.absolutePath |
49 try { | 49 try { |
50 if (!target.exists() || target.lastModified() < source.getTime()) { | 50 if (!target.exists() || target.lastModified() < source.getTime()) { |
51 myJar.getInputStream(source).use { sfp -> | 51 myJar.getInputStream(source).use { sfp -> |
52 FileOutputStream(target).use { tfp -> | 52 FileOutputStream(target).use { tfp -> |
53 sfp.copyTo(tfp) | 53 sfp.copyTo(tfp) |