mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] better diagnostics for corrupted patch files (IDEA-247985)
GitOrigin-RevId: be0f30e29af50b5ecc7b7be56371c442539562d6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
00d58f3986
commit
8a25349b55
+9
-3
@@ -23,6 +23,7 @@ import java.io.IOException
|
||||
import java.net.URL
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.util.zip.ZipException
|
||||
import java.util.zip.ZipFile
|
||||
import javax.swing.JComponent
|
||||
import javax.swing.UIManager
|
||||
@@ -61,11 +62,16 @@ internal object UpdateInstaller {
|
||||
}
|
||||
}
|
||||
HttpRequests.request(url).gzip(false).saveToFile(patchFile, partIndicator)
|
||||
ZipFile(patchFile).use {
|
||||
if (it.getEntry(PATCH_FILE_NAME) == null || it.getEntry(UPDATER_ENTRY) == null) {
|
||||
throw IOException("Corrupted patch file: ${patchFile.name}")
|
||||
try {
|
||||
ZipFile(patchFile).use {
|
||||
if (it.getEntry(PATCH_FILE_NAME) == null || it.getEntry(UPDATER_ENTRY) == null) {
|
||||
throw IOException("Corrupted patch file: ${patchFile.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e: ZipException) {
|
||||
throw IOException("Corrupted patch file: ${patchFile.name}", e)
|
||||
}
|
||||
files += patchFile
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user