Commit 803bf261 by Amelin Konstantin

Add not Directory check in zip entries

parent 5612cb33
...@@ -43,22 +43,24 @@ object Main { ...@@ -43,22 +43,24 @@ object Main {
while (fZipEntries.hasMoreElements) { while (fZipEntries.hasMoreElements) {
val e = fZipEntries.nextElement val e = fZipEntries.nextElement
val fZipEntryName = e.getName if (!e.isDirectory) {
val nowForZip = LocalDateTime.now().toString val fZipEntryName = e.getName
val nowForZip = LocalDateTime.now().toString
Try {
convert( Try {
fZip.getInputStream(e), convert(
s"${fSourceNameBase}_$fZipEntryName", fZip.getInputStream(e),
s"Converted_${fSourceNameBase}_$fZipEntryName", s"${fSourceNameBase}_$fZipEntryName",
nsdXmlValid, s"Converted_${fSourceNameBase}_$fZipEntryName",
rtsXmlValid, nsdXmlValid,
p) rtsXmlValid,
} match { p)
case Success((oXml, ti)) => } match {
XML.save(Paths.get(args(1), s"Converted_${fSourceNameBase}_$fZipEntryName").toString, oXml, xmlDecl = true) case Success((oXml, ti)) =>
logString += s"$nowForZip\n$ti" XML.save(Paths.get(args(1), s"Converted_${fSourceNameBase}_$fZipEntryName").toString, oXml, xmlDecl = true)
case Failure(ex) => logString += s"'$nowForZip\nImpossible to convert'${fSourceNameBase}_$fZipEntryName': ${ex.getMessage}\n\n" logString += s"$nowForZip\n$ti"
case Failure(ex) => logString += s"'$nowForZip\nImpossible to convert'${fSourceNameBase}_$fZipEntryName': ${ex.getMessage}\n\n"
}
} }
} }
} match { } match {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment