It's not a secret anymore!*
The moose likes Applets and the fly likes LOCAL third party JAR FILE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "LOCAL third party JAR FILE" Watch "LOCAL third party JAR FILE" New topic
Author

LOCAL third party JAR FILE

Rakesh Ray
Ranch Hand

Joined: Jul 25, 2001
Posts: 51
Hi, my applet is using third party API's bundled in JAR file.
To avoid downlaod each time I copied the JAR file on users PC.
Everything is fine if that file is there at a perticular location.
In case the JAR file is not there in user's PC class loader in the browser fails. Is there anywayof catching it and give proper message to user. In IE I can catch ClassNotFound exception in the constructor of the applet. For netscape it is not even coming to my code?
Any suggestions..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

I don't know how well that works. The applet classloader may reject a third-party JAR if it's not signed. This would be to avoid "Trojan" jars from being substituted, violating the integrity of the system. It's also probably too much work, since the applet classloader will generally cache the jar anyway.


Customer surveys are for companies who didn't pay proper attention to begin with.
Rakesh Ray
Ranch Hand

Joined: Jul 25, 2001
Posts: 51
Thanx for reply Tim.
Can you please explain the last line, I did not understand it.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

In most cases your web browser will download the jar once and save it in a temporary (cache) directory. Then when the user revisits that web page and needs the jar again, instead of downloading the jar again, the java VM uses the copy that was stored in the cache.
The cache eventually gets cleared out, however. Otherwise your hard drive might fill up with cached stuff. Also, you don't want the user to be working with an old, out-of-date copy of the jar.
How long an item remains in cache is dependent on the browser. Most browsers allow the user to fine-tune this interval from no-caching all the way up to possibly forever.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LOCAL third party JAR FILE