From e6cefaddbbbe08071608b1bd81aa9d1adb027405 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 19 Feb 2018 11:31:35 +0100 Subject: [PATCH] [platform] corrects directory checks in plugin installer actions --- .../intellij/ide/startup/StartupActionScriptManager.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/bootstrap/src/com/intellij/ide/startup/StartupActionScriptManager.java b/platform/bootstrap/src/com/intellij/ide/startup/StartupActionScriptManager.java index 6d4688a08016..5ec011fddcd6 100644 --- a/platform/bootstrap/src/com/intellij/ide/startup/StartupActionScriptManager.java +++ b/platform/bootstrap/src/com/intellij/ide/startup/StartupActionScriptManager.java @@ -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);