After crawling through a lot of threads, the consensus in the SDK Forums is that the TryGetEntryInfo method is the best way to see if a folder exists, and that FolderInfo.Create is the best way to create a folder if it does not.
So we have a situation where there is definitely a parent folder, and we want to create a single sub folder.
The line
LF_FolderInfo = Entry.TryGetEntryInfo(sParentFolder, LF_Session)
Works fine, and populates the FolderInfo Object without any issue.
Logically, we'd then run:
LF_FolderInfo.Create((sParentFolder & sNewSubFolder), EntryNameOption.None)
where sParentFolder definitely ends with a slash, and sNewSubFolder definitely does not exist.
Not matter whether the folder creation code is in the same routine or we split it off to a different Sub, it always fails with the message, "Only new objects support this operation".
The only way we've gotten this to work is via:
Dim LF_FolderInfo As Laserfiche.RepositoryAccess.FolderInfo = Nothing
LF_FolderInfo = Folder.GetFolderInfo(sParentFolder, LF_Session)
Dim nRet As Integer = Folder.Create(sParentFolder & sNewSubFolder, "Default", EntryNameOption.None, LF_Session)
So are we missing something obvious?
TIA