@Override
  public Object @NotNull [] getChildElements(@NotNull Object nodeElement) {
    if (!(nodeElement instanceof FileElement element)) {
      return ArrayUtilRt.EMPTY_OBJECT_ARRAY;
    }

    VirtualFile file = element.getFile();

    if (file == null || !file.isValid()) {
      if (element == myRootElement) {
        return myRootElement.getChildren();
      }
      return ArrayUtilRt.EMPTY_OBJECT_ARRAY;
    }

    VirtualFile[] children = null;

    if (element.isArchive() && myChooserDescriptor.isChooseJarContents()) {
      String path = file.getPath();
      if (!(file.getFileSystem() instanceof JarFileSystem)) {
        file = JarFileSystem.getInstance().findFileByPath(path + JarFileSystem.JAR_SEPARATOR);
      }
      if (file != null) {
        children = file.getChildren();
      }
    }
    else {
      children = file.getChildren();
    }

    if (children == null) {
      return ArrayUtilRt.EMPTY_OBJECT_ARRAY;
    }

    Set<FileElement> childrenSet = new HashSet<>();
    for (VirtualFile child : children) {
      if (myChooserDescriptor.isFileVisible(child, myShowHidden)) {
        final FileElement childElement = new FileElement(child, child.getName());
        childElement.setParent(element);
        childrenSet.add(childElement);
      }
    }
    return ArrayUtil.toObjectArray(childrenSet);
  }
@Override
  public Object @NotNull [] getChildElements(@NotNull Object nodeElement)