Re: How to make java client app to download jar package from server autoly?
sealo wrote:
On 1=D4 1=C8=D5, =CF =CE=E72=CA=B136=B7=D6, "Andrew Thompson"
<andrewtho...@gmail.com> wrote:
Please refrain from top-posting. It makes
threads very hard to follow.
(top-post corrected, as an example.
no guarantees on attributions)
(sealo)
..I will try to use "URLClassLoader" to have a try.
Are you going to cache the jar locally, for future use?
I think it will be a cache usage.
That makes sense, otherwise there will be a
noticable delay at start-up, while the Jar is
fetched fresh from the server.
You might use an URLClassLoader to download
the classes initially, but you might also simply
open an generic ( URL.openStream() style)
Inputstream, get the bytes of the Jar, store those
bytes to the local file system, then add the
downloaded Jar to the classpath at run-time.
The reason I have kept focusing (to the point of
tunnel vision) on web-start, is because it provides
an inbuilt way to do not only that, but also to
update the local Jar, if the Jar on the server
is updated!
That might 'never happen', and there are also ways
for a *command* *line* based app. to check for updates
itself, but if this *might* be useful for your application,
it is getting to the point of 'reinventing the wheel', since
web-start is an established deployment technology
that is well suited to the task described.
So far, you have been very vague* about what this
application actually *does*. Could you fill in a little
detail? It might help me determine exactly what level
of privileges it needs.
(Note that this is significant for the web-start application,
which by default operates in an applet like security
sandbox - I am guessing your application ight need
extended privileges to access files, or get secure
system properties..)
* As an aside, I find it very frustrating to be discussing
technical details of an 'application'. What the heck does
it *do*? What is it, some sort of 'state secret'?
Andrew T.