Copying resources to client machine
Hi,
We have an application that I have to "web start enable". The application consists of a number of jars. During the "deployment" function of it, it copies jars from the install location to the "deployment" location.
Since I don't have an install location now, this is a problem. I found some posts that allows me to copy a specific file from a resource, but nothing on copying to whole resource. I have tested it with JDK 6
Is there a way to copy the jars?
Thanks in advance.
[510 byte] By [
Mossiea] at [2007-11-26 22:57:18]

# 1
> We have an application that I have to "web start enable".
You say that, like it's a bad thing.
> The application consists of a number of jars. During the
> "deployment" ..
'installer'*
> ..function of it, it copies jars from the install
> location to the "deployment" location.
Which is what? Typically or an example, will do.
> Since I don't have an install location now,
Why not?
You might use an installer to put the jar's in
a specific place (if that is what the application
requires), though I would advise to rework
that app. so these jars simply need to be
accessible on the class path.
Then the installer becomes unnecessary, and
the deployment is as simple as listing the jars
in the resources section of the JNLP file.
# 2
> You say that, like it's a bad thing.
I sertainly didn't mean it in a bad way :-)
Let me try and explain again:
Currently our application gets installed, using InstallShield. The app consists of a number of jar files, that gets place under Installdir/lib.
Right, when the user runs the application, there is a function to generate(deploy) java code from some models. In this process we copy some of the jars to the client's "deployment directory". These jars are necessary for running the "deploy/ generated" java code.
Now if I run my app using WS, then I specify all jars as resources, no problem, but how will I copy the jars to the client's "deployment/java code" directory?
I looked in the cache dir but all the file names were like: 2e7e1e9e-2b203321 with a 2e7e1e9e-2b203321.idx next to it.
I hope this explains it better.
Thanks again for your help.
# 3
It would be better if you reworked your app as Andrew suggested. Setting that aside, embed those jars in another jar and you can access the embedded jars using for example Class.getResourceAsStream("/embedded.jar"). And then copy/stream those jars anywhere you want.
Also you could just make a http request using URL("http://yoursite.com/jars/yourjar.jar").getConnection().... etc. to your server and copy/stream the jar files from there.