/* GetFile.java Burton Rosenberg Wed Jul 23 17:40:51 EDT 1997 And example of the URL object. */ import java.applet.* ; import java.awt.* ; import java.net.* ; import java.io.* ; public class GetFile extends Applet { public void init() { String fileName = getParameter("file") ; try { URL url = new URL(getDocumentBase(),fileName) ; DataInputStream dis = new DataInputStream( url.openStream() ) ; String lineOfInput ; while ( ( lineOfInput = dis.readLine()) != null ) System.out.println(lineOfInput) ; } catch ( FileNotFoundException fnf ) { System.out.println("FileNotFoundException: "+ fnf.getMessage() ) ; } catch ( IOException ioe ) { System.out.println("IOException: " + ioe.getMessage() ) ; } } }