/* Richard A. DeVenezia * SUGI 29 - "Greetings from the Edge" * www.devenezia.com/papers */ import java.io.*; public class Example10 { private FileInputStream fis; private String exceptionMessage; public Example10(String path) { try { this.fis = new FileInputStream (path); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); this.exceptionMessage = sw.toString(); } } public String getExceptionMessage () { return this.exceptionMessage; } public static void main (String arg[]) { Example10 me = new Example10 ("foo"); System.out.println(me.getExceptionMessage()); } }