This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Inquiry: How do you set the USERPATH APPPATH etc for the IDV xml resource files?
Hi Stu,
The IdvResourceManager does this:
/**
* Initialize the macro values
*
*/
private void initResourceMacros() {
macroNames = new String[] {
"%USERPATH%", "%SITEPATH%", "%IDVPATH%", "%DATAPATH%",
"%APPPATH%", "%VERSION%", "%VERSION.MAJOR%", "%VERSION.MINOR%",
"%VERSION.REVISION%"
};
macroValues = new String[] {
getUserPath(), getSitePath(), getIdvResourcePath(),
getDataResourcePath(), getAppResourcePath(),
getStateManager().getVersion(),
getStateManager().getVersionMajor(),
getStateManager().getVersionMinor(),
getStateManager().getVersionRevision()
};
}
For the app path it looks to see if there is an apppath property if not
it uses the package of the main IDV class.
For user path it calls: getStore().getUserDirectory().getPath();Which either looks at the command line -userpath argument or defaults to be ~/.metapps/<Main IDV Class Name>
Site path is either command line argument or from the User Preferences guiYou can change all of these by overwriting the appropriate IdvResourceManager method in a GeonResourceManager
class. -Jeff