boolean (@NotNull Path file) { var fs = file.getFileSystem(); if (fs.getClass().getModule() != Object.class.getModule()) { if (!System.getProperty("java.vm.vendor", "").contains("JetBrains") || JavaVersion.current().compareTo(JavaVersion.compose(17, 0, 6, 894, false)) < 0) { return false; } try { fs.provider().getClass().getMethod("getSunPathForSocketFile", Path.class); } catch (NoSuchMethodException | SecurityException e) { return false; } } if (!SystemInfoRt.isUnix) { try { SocketChannel.open(StandardProtocolFamily.UNIX).close(); } catch (UnsupportedOperationException e) { return false; } catch (IOException ignored) { } } return true; }