import java.net.*;
import java.io.*;

public class JarPrinter {
    static public void main(String [] args) throws Exception {
	String jarfile;
	// MSDOS/Windows names have colons in them that need to convert to
	// %3A, but can't convert / or \ to their URL equivalents
	int n=args[0].indexOf(':');
	if (n==-1)
	    jarfile=args[0];
	else
	    jarfile=args[0].substring(0,n)+"%3A"+args[0].substring(n+1);
	String urlstring  = "jar:file://"+ jarfile + "!/"+args[1];
	System.out.println("Opening: " + urlstring);
	URL url = new URL(urlstring);
	InputStream is=url.openStream();
	int c;
	do {
	    c=is.read();
	    if (c!=-1) System.out.print((char)c);
	} while (c!=-1);
	is.close();
    }
}
