-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
Honolulu Release
-
None
-
None
BluePrintArchiveUtils.deCompress function throws an exception java.io.FileNotFoundException: (Not a directory) when .tar archive contains blank entry!!.name. In that case the entry is treated as a file, creates a file from the last element of targetPath and an exception java.io.FileNotFoundException: (Not a directory) is thrown as a consequence.
The check for "not blank" entry!!.name before processing of each element, should fix that issue. The part of discussed code of BluePrintArchiveUtils.deCompress is below:
enumeration.use { while (enumeration!!.hasMoreElements()) { val entry: ArchiveEntry? = enumeration.nextElement() XXXXX Check for nonBlank entry.getName() XXXXX val destFilePath = File(targetPath, entry!!.name) destFilePath.parentFile.mkdirs() if (entry!!.isDirectory) continue val bufferedIs = BufferedInputStream(enumeration.getInputStream(entry)) destFilePath.outputStream().buffered(1024).use { bos -> bufferedIs.copyTo(bos) } if (!enumeration.getHasSharedEntryInputStream()) bufferedIs.close() } }