private static boolean isEmptyDirectory(Path newPluginsDir) {
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(newPluginsDir)) {
      for (Path path : stream) {
        boolean hidden = SystemInfoRt.isWindows
                         ? Files.readAttributes(path, DosFileAttributes.class).isHidden()
                         : path.getFileName().startsWith(".");
        if (!hidden) {
          return false;
        }
      }
    }
    catch (IOException ignored) { }
    return true;
  }
private static boolean isEmptyDirectory(Path newPluginsDir)