Use the property IsFolder to check if the current object is a folder.
Returns true if the current object is a folder.
TJamShellListItem Class