[platform] corrects directory checks in plugin installer actions

This commit is contained in:
Roman Shevchenko
2018-02-19 15:38:08 +01:00
parent 785554db28
commit e6cefaddbb
@@ -1,4 +1,4 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.startup;
import com.intellij.openapi.application.PathManager;
@@ -129,7 +129,7 @@ public class StartupActionScriptManager {
}
File destDir = destination.getParentFile();
if (!(destDir.exists() || destDir.mkdirs())) {
if (!(destDir.isDirectory() || destDir.mkdirs())) {
throw new IOException("Cannot create directory: " + destDir);
}
@@ -167,9 +167,8 @@ public class StartupActionScriptManager {
throw new IOException("Source file missing: " + source);
}
File destDir = destination.getParentFile();
if (!(destDir.exists() || destDir.mkdirs())) {
throw new IOException("Cannot create directory: " + destDir);
if (!(destination.isDirectory() || destination.mkdirs())) {
throw new IOException("Cannot create directory: " + destination);
}
ZipUtil.extract(source, destination, myFilenameFilter);