private static @Nullable DirectoryEntries doCreateDirectoryEntries(@NotNull VirtualFile file) {
    if (file.isInLocalFileSystem() || file.getParent() != null) {
      if (file instanceof VirtualFileSystemEntry) {
        int nameId = ((VirtualFileSystemEntry)file).getNameId();
        if (nameId > 0) {
          DirectoryEntry newDir = new DirectoryEntry(nameId);
          return new DirectoryEntries(newDir, newDir);
        }
      }
      DirectoryEntry newDir = new DirectoryEntry(file.getName());
      return new DirectoryEntries(newDir, newDir);
    }

    DirectoryEntry first = null;
    DirectoryEntry last = null;
    for (String item : Paths.split(file.getUrl())) {
      DirectoryEntry current = new DirectoryEntry(item);
      if (first == null) first = current;
      if (last != null) last.addChild(current);
      last = current;
    }

    if (first == null) return null;
    return new DirectoryEntries(first, last);
  }
private static @Nullable DirectoryEntries doCreateDirectoryEntries(@NotNull VirtualFile file)