aspose file tools
The moose likes Applets and the fly likes JarURLConnection from an applet, anyone tried? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "JarURLConnection from an applet, anyone tried?" Watch "JarURLConnection from an applet, anyone tried?" New topic
Author

JarURLConnection from an applet, anyone tried?

raimondas zemaitis
Ranch Hand

Joined: Feb 23, 2001
Posts: 104
Does anyone tried to use JarURLConnection class to get resources
from the server ?
I am trying to use but this piece of code gives exception in the
browser (with appletviewer works perfectly)
URL url = new URL(getDocumentBase(), "restImages.jar!/");
url = new URL("jar:" + url.toString());
JarURLConnection jar = (JarURLConnection)url.openConnection();
JarFile jarFile = jar.getJarFile();
InputStream iStream = getClass().getResourceAsStream("restImages.dat");
^^^^^^^^^I get iStream == null
BufferedInputStream bStream =
new BufferedInputStream(iStream);
ObjectInputStream oStream = new ObjectInputStream(bStream);
restImages = (int[][][])oStream.readObject();
What I want to do is to load the rest of images in the applet in the background with separate thread while first portion from
<ARCHIVE=some.jar> is being processed. JAR file being loaded here
contains file restImages.dat with images already pre-processed
[This message has been edited by raimondas zemaitis (edited February 23, 2001).]
 
 
subject: JarURLConnection from an applet, anyone tried?
 
Threads others viewed
extract directory from current jar
Downloading file from FTP using Java
Downloading file from FTP using Java
Getting a zip File Using a URL
Extracting Images from the image jar file
developer file tools