Skip to main content
Sep 17, 2021 2:49 PM UTC
Question

FileRepository Services

In runtime, if C:\ThingworxStorage\repository\SystemRepository\x\y\z is not in thingworxstorage means, BrowseFileSystem & BrowseDirectory APIs reading the files which is in C:\ThingworxStorage\repository\SystemRepository. Even catch block is not capturing any error. If the path is not present, script should stop and throw error. How to do that??

4 replies

Sep 20, 2021 12:40 PM UTC

First of all I would experiment a little bit with the services to see if there is one that a Try Catch can still help identify.

But else, if you know the structure that should exist, you can always iterate down and use Get Directory services to verify if the folder exists or not.

Sep 22, 2021 9:37 AM UTC

But GetDirectoryStructure Service of FileRepository doesn't takes any inputs and its output is a infotable. Any service is there which will return whether the path exists or not in boolean value??

Sep 22, 2021 1:57 PM UTC

It will return an infotable that you can check the content of

Sep 29, 2021 1:57 PM UTC

Hi @AP_9587236.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon