aspose file tools*
The moose likes JNLP and Web Start and the fly likes Using IntegrationService to interrogate the desktop shortcut Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Using IntegrationService to interrogate the desktop shortcut " Watch "Using IntegrationService to interrogate the desktop shortcut " New topic
Author

Using IntegrationService to interrogate the desktop shortcut

Mathew Broughton
Greenhorn

Joined: Oct 03, 2011
Posts: 3

Good Morning,

I have my web start app working fine and now need to go a bit beyond the basics\conventional.

Basically I would like to programmatically - in my web start app - retrieve the location of the client cached jnlp file* as stored in the auto created desktop shortcut target (on windows at least); usually as something like:

C:\Windows\SysWOW64\javaws.exe -localfile "C:\Users\matb\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\1\60d71e41-5efb04d0"

It would appear the IntegrationService is almost what I need with its methods to determine if the jnlp app has desktop or menu shortcuts. However the IntegrationService has very limited exposed functionality.

Does anyone know the best way to do this? The information must be available somewhere as JWS created the shortcut. A quick look through the source code indicates I may have to make use of the com.sun.deploy.cache package myself - but I am hoping there is another easier, cleaner more obvious way.

Cheers

Mat

*The reason I want the shortcut target is that armed with this information it is possible to programatically schedule my web start app to ..start automatically via the Windows task scheduler (via at or schtasks command). I can schedule the web start app manually at the moment in this way, but ideally would like the web start app to schedule itself.
Mathew Broughton
Greenhorn

Joined: Oct 03, 2011
Posts: 3

Fear not I have answered it myself. If you get hold of the JnlpClassLoader and from that retrieve the com.sun.javaws.jnlLaunchDesc object, i.e:

LaunchDesc launchDesc = jnlpClassLoader.getLaunchDesc();

Then the LaunchDesc object holds the location of the cached jnlp file (well indirectly, I copied the following helper method from com.sun.javaws.LocalInstallHandler to get the jnlp location).


Why there isn't more functionality available on the IntegrationService itself I don't know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using IntegrationService to interrogate the desktop shortcut