Commit 803bf261 by Amelin Konstantin

Add not Directory check in zip entries

parent 5612cb33
......@@ -43,22 +43,24 @@ object Main {
while (fZipEntries.hasMoreElements) {
val e = fZipEntries.nextElement
val fZipEntryName = e.getName
val nowForZip = LocalDateTime.now().toString
Try {
convert(
fZip.getInputStream(e),
s"${fSourceNameBase}_$fZipEntryName",
s"Converted_${fSourceNameBase}_$fZipEntryName",
nsdXmlValid,
rtsXmlValid,
p)
} match {
case Success((oXml, ti)) =>
XML.save(Paths.get(args(1), s"Converted_${fSourceNameBase}_$fZipEntryName").toString, oXml, xmlDecl = true)
logString += s"$nowForZip\n$ti"
case Failure(ex) => logString += s"'$nowForZip\nImpossible to convert'${fSourceNameBase}_$fZipEntryName': ${ex.getMessage}\n\n"
if (!e.isDirectory) {
val fZipEntryName = e.getName
val nowForZip = LocalDateTime.now().toString
Try {
convert(
fZip.getInputStream(e),
s"${fSourceNameBase}_$fZipEntryName",
s"Converted_${fSourceNameBase}_$fZipEntryName",
nsdXmlValid,
rtsXmlValid,
p)
} match {
case Success((oXml, ti)) =>
XML.save(Paths.get(args(1), s"Converted_${fSourceNameBase}_$fZipEntryName").toString, oXml, xmlDecl = true)
logString += s"$nowForZip\n$ti"
case Failure(ex) => logString += s"'$nowForZip\nImpossible to convert'${fSourceNameBase}_$fZipEntryName': ${ex.getMessage}\n\n"
}
}
}
} 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