public static boolean canConnectUnixSocket(File path) {
        try (UnixSocketChannel channel = UnixSocketChannel.open()) {
            return channel.connect(new UnixSocketAddress(path));
        } catch (IOException e) {
            return false;
        }
    }
Check whether we can connect to a local Unix socket
src/main/java/io/fabric8/maven/docker/access/util/LocalSocketUtil.java