public static void migratePlugins(Path newPluginsDir, List<IdeaPluginDescriptor> descriptors, Logger log) throws IOException {
    for (IdeaPluginDescriptor descriptor : descriptors) {
      Path pluginPath = descriptor.getPluginPath();
      PluginId pluginId = descriptor.getPluginId();
      if (pluginPath == null) {
        log.info("Skipping migration of plugin '" + pluginId + "', because it is officially homeless");
        continue;
      }

      log.info("Migrating plugin '" + pluginId + "' version: " + descriptor.getVersion());
      Path target = newPluginsDir.resolve(pluginPath.getFileName());
      if (Files.isDirectory(pluginPath)) {
        FileUtil.copyDir(pluginPath.toFile(), target.toFile());
      }
      else {
        Files.createDirectories(newPluginsDir);
        Files.copy(pluginPath, target);
      }
    }
  }
public static void migratePlugins(Path newPluginsDir, List<IdeaPluginDescriptor> descriptors, Logger log)