Skip to main content
1-Visitor
December 8, 2015
Question

How to get absolute path of ThingWorx Repository ?

  • December 8, 2015
  • 4 replies
  • 7769 views

         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=”\\”).

    4 replies

    14-Alexandrite
    December 9, 2015

    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,

    1-Visitor
    December 28, 2015
    1-Visitor
    March 1, 2016

    Could anyone please guide me to identify the absolute path of repository of ThingWorx instance running on cloud like (ge2-xxx.cloud.thingworx.com)...

    22-Sapphire I
    March 1, 2016

    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

    1-Visitor
    March 2, 2016

    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.

    1-Visitor
    March 1, 2016

    If you build a Server Side Extension ( java ) you can easily get it with:

    ApplicationContext.getInstance().getRepositoryDirectory()

    1-Visitor
    March 3, 2016

    Thanks.....