ThingWorx Edge Java SDK Edge Extensions > Configuring an Edge Thing Shape > Changing the Location of Local Configuration Files
Changing the Location of Local Configuration Files
The default location of all ETS local configuration files is the directory specified in the user.dir VM system property, which by default points to the current working directory of your edge application. If this location is not writable or is not appropriate for the particular ETS, you can change it. To change the default location of all ETS configuration files, set the system property, com.thingworx.edge.thingshapes.configLocation, to a URL that points to a new location on a local drive. For example, settingcom.thingworx.edge.thingshapes.configLocation to file:///etc/conf would write all ETS generated configuration files to /etc/conf if the edge application has write permission for this directory.
Each ETS can also specify its configuration file should be stored. To do this, add the ETS name to the end of the system property. With this setting, any value set for Edge Thing Shapes will be overridden. For example, suppose you have an ETS with the name, SimpleLogServiceShape. If you set the system propertycom.thingworx.edge.thingshapes.configLocation.SimpleLogServiceShape to file:///usr/local/conf, only theSimpleLogServiceShape would read and write its configuration in /usr/local/conf.
The default mechanism for persisting configuration is to create files on a local drive. If you need to load a configuration file from a remote location, you can overrideloadLocalConfiguration() inside your ETS implementation. This function is responsible for returning the current configuration infotable from wherever it is persisted. By overriding this function, you can redirect the loading of your configuration in any way required. For example, it could be loaded from a remote web service.
The method of saving a configuration that has changed can be modified by overridingsaveLocalConfiguration(). Call this function when you have modified the ETS configuration and you want to persist it so that you can use it the next time the ETS is started. By overriding this function, you could, for example save your configuration to a remote web service.
Was this helpful?