void (@NotNull Path _dir, @Nullable Path _toSelect) { String dir = _dir.toAbsolutePath().normalize().toString(); String toSelect = _toSelect != null ? _toSelect.toAbsolutePath().normalize().toString() : null; String fmApp; if (SystemInfo.isWindows) { if (JnaLoader.isLoaded()) { openViaShellApi(dir, toSelect); } else { openViaExplorerCall(dir, toSelect); } } else if (SystemInfo.isMac) { if (toSelect != null) { spawn("open", "-R", toSelect); } else { spawn("open", dir); } } else if ((fmApp = Holder.fileManagerApp) != null) { if (toSelect != null && fmApp.endsWith("dolphin")) { spawn(fmApp, "--select", toSelect); } else if (toSelect != null && fmApp.endsWith("dde-file-manager")) { spawn(fmApp, "--show-item", toSelect); } else { spawn(fmApp, toSelect != null ? toSelect : dir); } } else if (SystemInfo.hasXdgOpen()) { spawn("xdg-open", dir); } else if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { if (LOG.isDebugEnabled()) LOG.debug("opening " + dir + " via Desktop API"); ProcessIOExecutorService.INSTANCE.execute(() -> { try { Desktop.getDesktop().open(new File(dir)); } catch (Exception e) { LOG.warn(e); } }); } else { Messages.showErrorDialog(IdeBundle.message("message.this.action.isn.t.supported.on.the.current.platform"), IdeBundle.message("dialog.title.cannot.open.file")); } }