1 28 29 package com.caucho.vfs; 30 31 import java.io.IOException ; 32 33 public class IOExceptionWrapper extends IOException { 34 private Throwable _rootCause; 35 36 public IOExceptionWrapper() 37 { 38 } 39 40 public IOExceptionWrapper(String message) 41 { 42 super(message); 43 } 44 45 public IOExceptionWrapper(String message, Throwable e) 46 { 47 super(message); 48 49 _rootCause = e; 50 } 51 52 public IOExceptionWrapper(Throwable e) 53 { 54 super(e.toString()); 55 56 _rootCause = e; 57 } 58 59 public static IOException create(Exception e) 60 { 61 if (e instanceof IOException ) 62 return (IOException ) e; 63 else 64 return new IOExceptionWrapper(e); 65 } 66 67 public Throwable getRootCause() 68 { 69 return _rootCause; 70 } 71 72 public Throwable getCause() 73 { 74 return _rootCause; 75 } 76 } 77 | Popular Tags |