FileDocCategorySizeDatePackage
WriteTest.javaAPI DocExample2462Sun Oct 25 18:13:34 GMT 1998None

WriteTest

public class WriteTest extends Applet

Fields Summary
String
codebase
Constructors Summary
public WriteTest()

public WriteTest(String s)

	codebase = s;
    
Methods Summary
public voidinit()

	codebase = getCodeBase().getFile();
    
public static voidmain(java.lang.String[] args)

	WriteTest wt = new WriteTest("/tmp");
	wt.start();
    
public voidstart()

	System.out.println("Codebase is " + codebase);
	System.out.println("Attempting to open file for reading");
	try {
	    FileInputStream fis = new FileInputStream(codebase + "/sdoRead");
	    System.out.println("got input stream");
	} catch (SecurityException se) {
	    System.out.println("got security exception");
	} catch (Exception e) {
	    System.out.println("got other exception " + e);
	}

	System.out.println("Attempting to open file for writing");
	try {
	    FileOutputStream fis = new FileOutputStream(codebase + "/sdoWrite");
	    System.out.println("got output stream");
	} catch (SecurityException se) {
	    System.out.println("got security exception");
	} catch (Exception e) {
	    System.out.println("got other exception " + e);
	}