Your instinct is GREAT!
The problem lies in the URL.
First, there is JarURLConnettion:
pubic abstract class JarURLConnection extends URLConnection //
Java 1.2
Second, we need a "jar URL", which is constructed in the following way:
suppose you have a URL:
http://ttcplinux.sourceforge.net/java/network.jar, and in the .jar, you want the file:
com/arpabox/net/Ping.class
The corresponding "jar URL" is:
jar:http://ttcplinux.sourceforge.net/java/network.jar!/com/arpabox/net/Ping.class
Get it??
Another example:
URL:
ftp:///D%7d/java/network.jar file: com/arpabox/net/Ping.class
Jar URL: jar:ftp://D%7d/java/network.jar!/com/arpabox/net/Ping.class
So, here, you now how to construct the "Jar URL".
Then, use it to read the html file as follows:
try {
URL u = new URL("jar:http://ttcplinux.sourceforge.net/java/network.jar!/com/arpabox/net/index.html");
URLConnection uc = u.openConnection();
InputStream in = uc.getInputStream();
Reader r = new InputStreamReader(in);
int c;
while ((c = r.read()) != -1) {
System.out.print((char)c);
}
}
catch (IOException e) {
system.err.println(e);
}