import java.io.*; import java.net.*; import java.util.*; public class TSVContentTester { private static void test(URL u) throws IOException { Object content = u.getContent(); Vector v = (Vector) content; for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { String[] sa = (String[]) e.nextElement(); for (int i = 0; i < sa.length; i++) { System.out.print(sa[i] + "\t"); } System.out.println(); } } public static void main (String[] args) { // uncomment these lines in Java 1.2 String pkgs = System.getProperty("java.content.handler.pkgs", ""); if (!pkgs.equals("")) { pkgs = pkgs + "|"; } pkgs += "com.macfaq.net.www.content"; System.setProperty("java.content.handler.pkgs", pkgs); for (int i = 0; i < args.length; i++) { try { URL u = new URL(args[i]); test(u); } catch (MalformedURLException e) { System.err.println(args[i] + " is not a good URL"); } catch (Exception e) { e.printStackTrace(); } } } }