Download a license.bea file in webstart cache
Hi All,
In my application i have a requirement where i need to set Bea.Home to the license.bea path in the system properties. I have managed to download this license file to the webstart download directory by placing it within a .jar file.The application is unable to read it from the jar.
Please let me know :
1. How can i extract the license file to the download directory automatically.
2. Or is there any way by which i can download the license file directly throug webstart( insted of downloading it as a jar )
Thanks & regards,
Ravi
[586 byte] By [
Raj-ka] at [2007-11-27 6:51:30]

# 4
https://java.sun.com/products/javawebstart/1.0.1/javadoc/javax/jnlp/ExtensionInstallerService.html
It seems like the functionality for this is supplied
by the ExtensionInstallerService.
Normally it is used to install natives and such,
but is well suited to what you need to do.
An installer is run once before the application
is invoked, and again when it is uninstalled
(with different arguments).
The process might be..
1) get an URL to the license file
2) Ask the user where they would like to put
the license file.
3) Download the bytes of the license file, and
write them to the local file system.
4) Set the property as appropriate.
5) Inform the JNLP client that
installSucceeded()
[ 6) The application should appear on-screen
after 5), with the property set to the place where
the license file is located. ]
Notes:
- Parts 1 thru 4 are all J2SE core. You will need
to code that part yourself.
- Part 2 (ask user) is optional, you might simply
put the license file in a sub-directory of user.home.
The best sub-directory for it, would be based on
(for example) your package names - the final
path being something like
{$user.home}/com/ourcompany/thecode/
This helps avoid overwiting other files of
the same name (or having your file similarly
overwritten).
- Trying to find things in the web start cache is
a lost cause. The location may change at the
next Java release, or at the user's whim. (My
system's cache location has changed twice today -
simply because I chose to change it.)