Skip to main content
17-Peridot
September 17, 2021
Question

FileRepository Services

  • September 17, 2021
  • 2 replies
  • 1381 views

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??

2 replies

22-Sapphire I
September 20, 2021

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.

17-Peridot
September 22, 2021

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??

22-Sapphire I
September 22, 2021

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

Support
September 29, 2021

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