private static int depth(VirtualFile file) {
    int depth = 0;
    while (file != null) {
      depth++;
      file = file.getParent();
    }
    return depth;
  }
private static int depth(VirtualFile file)