Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I need absolute path of ThingWorx repository in one of service, how i can get it in service? As of now I have added hard coded value for it (C:\\ThingworxStorage\\repository\\).
Also is there any inbuilt function to get file separator for underlying operating system. I have added hard coded value for it (fileSeparator=”\\”).
Ramesh,
There is no service function to get an absolute path or file separator. We do not want to expose any underlying OS or file system structure via Thingworx as in some cases it is considered a potential security issue. All access is therefore controlled via Thingworx and its security structure,
Could anyone please guide me to identify the absolute path of repository of ThingWorx instance running on cloud like (ge2-xxx.cloud.thingworx.com)...
What is the use case? Why would you need the absolute path?
You can get paths to files in the FileRepository using the GetFileListingWithLinks service for example, those would be URLs
Thanks for prompt reply Pai... The use case is :
1. I wanted to upload files to ThingWorx cloud repository.
2. Later I wanted to download those from my android mobile , or in my raspberry pi gateway.
My guess is , if I can obtain the absolute path - i can use rest service to download the files.
Are you saying you want to download these files without going through Thingworx?
That doesn't seem secure.
I recommend using the Thingworx FileRepository URLs and have them provide user and password.
When I am trying to access the fileRepository URL using rest, it is prompting for username and password.
When I enter my creds it does not login...
This happens with my cloud instance as well. When I directly hit my cloud instance http://ge2-5506.cloud.thingworx.com/Thingworx/Composer/index.html on browser, it prompts for username and password - when I enter correct details... it does not login and continously prompts for credentials.
However, when I login into my account , and select a application and then go to platform it successfully logins into cloud instance composer.
Why does it happen? Please guide me...
Thanks in advance!!
If you use the Link given from getfilelistingwithlinks, it should directly open or download the file it points to without needing a session.
If you point to the FileRepository itself, it wants to establish a session.
if it isn't properly behaving for you like that, you might consider using an appkey and pass that in with the call.
Thanks...that worked!!
If you build a Server Side Extension ( java ) you can easily get it with:
ApplicationContext.getInstance().getRepositoryDirectory()
Thanks.....
Hi there,
The whole class com.thingworx.system.ApplicationContext seems to be gone in Thingworx Extensions SDK 7.1. How can I get the repository directory now?
Thank you,
João