cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

FileRepository Services

AP_9587236
17-Peridot

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 4
PaiChung
22-Sapphire I
(To:AP_9587236)

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.

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

PaiChung
22-Sapphire I
(To:AP_9587236)

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

slangley
23-Emerald II
(To:AP_9587236)

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

Top Tags