I am working on a program that can be ran either in Web Start or Standalone mode. Is there a way I can tell inside the code which mode I am in?
The reason why I ask is because if I am in Web Start mode I store files using the PersistenceService api... but of course this will not work in Standalone mode. So in Standalone mode I want to just store in working directory.
Check for presence of security manager.
In webstart mode your code will run in the sandbox (even if it is singed security manager will be installed).
Or you can simply use class for name to lookup for PersistanceService. It is not on the default classpath for standalone application.