1 package org.codehaus.groovy.syntax; 2 3 import org.codehaus.groovy.GroovyException; 4 5 import java.io.IOException ; 6 7 10 11 public class ReadException extends GroovyException { 12 private IOException cause = null; 13 14 public ReadException(IOException cause) { 15 super(); 16 this.cause = cause; 17 } 18 19 public ReadException(String message, IOException cause) { 20 super(message); 21 this.cause = cause; 22 } 23 24 public IOException getIOCause() { 25 return this.cause; 26 } 27 28 public String toString() { 29 String message = super.getMessage(); 30 if (message == null || message.trim().equals("")) { 31 message = cause.getMessage(); 32 } 33 34 return message; 35 } 36 37 public String getMessage() { 38 return toString(); 39 } 40 } 41 | Popular Tags |