You are viewing limited content. For full access, please sign in.

Question

Question

Is this an Image Document or Folder using SDK 9.0

asked on July 24, 2014

Hi There,

 

I am trying to find out if the object is a folder or image document. How to find this out using SDK and VB .NET?

 

Is the following steps are correct?

 

Dim docInfo As DocumentInfo
docInfo = Document.GetDocumentInfo(docPath & docName, mySess)
docInfo.EntryType

 

I am writing an export utility to export Image documents and sub folders from repository. So, I want to know if this object is folder or image document.

 

-Prakash

 

0 0

Answer

SELECTED ANSWER
replied on July 25, 2014 Show version history

You can do something like this

        Dim entInfo As EntryInfo
        entInfo = Entry.GetEntryInfo(EntryPathOrID, mySess)
        If entInfo.EntryType = EntryType.Document Then
            Dim docInfo As DocumentInfo = DirectCast(entInfo, DocumentInfo)
            ' Process Document
            docInfo.Dispose()
        ElseIf entInfo.EntryType = EntryType.Folder Then
            Dim foldInfo As FolderInfo = DirectCast(entInfo, FolderInfo)
            ' Process Folder
            foldInfo.Dispose()
        End If
        entInfo.Dispose()

 

0 0

Replies

replied on July 24, 2014

The `EntryType` property will tell you the type of the entry, but if the path and name refer to a folder then Document.GetDocumentInfo will throw an exception.  Use Entry.GetEntryInfo if you need it to work for all entry types or you don't know the type in advance.

1 0
replied on July 24, 2014

Hi Brian,

 

Is there any documentation for the "entryInfo.EntryType" for folder, document and etc ?

 

I am able to use retrieve the EntryType.

 

-Prakash

0 0
SELECTED ANSWER
replied on July 25, 2014 Show version history

You can do something like this

        Dim entInfo As EntryInfo
        entInfo = Entry.GetEntryInfo(EntryPathOrID, mySess)
        If entInfo.EntryType = EntryType.Document Then
            Dim docInfo As DocumentInfo = DirectCast(entInfo, DocumentInfo)
            ' Process Document
            docInfo.Dispose()
        ElseIf entInfo.EntryType = EntryType.Folder Then
            Dim foldInfo As FolderInfo = DirectCast(entInfo, FolderInfo)
            ' Process Folder
            foldInfo.Dispose()
        End If
        entInfo.Dispose()

 

0 0
replied on July 25, 2014

Thanks Bert . That helped a lot.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.