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

Question

Question

Best way to determine if a folder exists with SDK

asked on April 28, 2014

Good Afternoon,

 

I'm looking for a simple and elegant way to check to see if a folder exists in the repository, and if it doesn't then create the full path to that folder.

 

Bert Warren posted a function but it doesn't play well with my existing import program. I'm also looking for something that is not quite as complex because I need to integrate with my existing sessions. When I attempted to use the function in my VAR kit it continually will exceed the subscriber limits.

 

Blake Smith discussed using a workflow, and while this would be very easy for me to create, I really want to master RA and the Laserfiche SDK. 

 

I've looked in the SDK help files and I have learned how to create the last folder in the chain,

 

 ' Manipulate the path 
                ' Sample path is c:\1234test\1
                ' currentrow(3) is the sample path
                Dim withParts As String = currentrow(3)
                Dim withoutParts As String = Replace(withParts, "c:\", "\")
                Dim Gotthefullpath = currentrow(3)

                '*********************
                '* CHECK THE FOLDERS *
                '*********************
                Folder.Create(withoutParts, "default", EntryNameOption.AutoRename, session)

 

but I'm not sure what the best method would be for creating the parent structure down to that final folder. Additionally I'm curious as to the best way to verify the folder existence so that I don't end up with duplicates.

 

Any thoughts?

 

Best Regards,

Brian

 

 

Answer

APPROVED ANSWER
replied on April 28, 2014

Replies

replied on April 28, 2014

The Solution Mathew discusses works perfectly when converted to VB from C#.

 

I think I'm going to have to learn C# and finish VBnet as well.

 

Thanks Bert!

You are not allowed to follow up in this post.