private static String @NotNull [] getRelativePath(@NotNull VirtualFile file, @NotNull VirtualFile root) {
    List<String> names = new ArrayList<>();

    VirtualFile parent = file;

    while (parent != null
           && !parent.equals(root)) {
      names.add(parent.getName());
      parent = parent.getParent();
    }

    if (names.isEmpty()) return ArrayUtil.EMPTY_STRING_ARRAY;
    String[] path = new String[names.size()];
    for (int i = 0; i < names.size(); i++) {
      path[i] = names.get(names.size() - i - 1);
    }
    return path;
  }
private static String @NotNull [] getRelativePath(@NotNull VirtualFile file, @NotNull VirtualFile root)