Checking if file exists in a BPM method directive

Did someone say my name? :grinning:

The safer way has already been provided. We introduced a new Sandbox class for custom code that (among other things), allows you to access the file system in a way that is safe and portable as we continue to evolve how Kinetic is hosted.

I created a gist with code samples that show how to use this. You will see that the syntax is almost identical. You replace System.IO with Sandbox.IO. The biggest difference is that instead of working with arbitrary absolute paths, you need to create a FilePath object that abstracts the destination of the file.

A lot of the credit for the information in that gist goes to @JeffLeBert.

Without further ado, here’s the gist:

7 Likes