1 16 package org.apache.commons.vfs; 17 18 import org.apache.commons.vfs.util.Messages; 19 20 import java.io.IOException ; 21 22 27 public final class FileSystemException 28 extends IOException 29 { 30 33 private final Throwable throwable; 34 35 38 private final String code; 39 40 43 private final String [] info; 44 45 50 public FileSystemException(final String code) 51 { 52 this(code, null, null); 53 } 54 55 61 public FileSystemException(final String code, final Object info0) 62 { 63 this(code, new Object []{info0}, null); 64 } 65 66 73 public FileSystemException(final String code, 74 final Object info0, 75 final Throwable throwable) 76 { 77 this(code, new Object []{info0}, throwable); 78 } 79 80 86 public FileSystemException(final String code, final Object [] info) 87 { 88 this(code, info, null); 89 } 90 91 98 public FileSystemException(final String code, 99 final Object [] info, 100 final Throwable throwable) 101 { 102 super(Messages.getString(code, info)); 103 104 if (info == null) 105 { 106 this.info = new String [0]; 107 } 108 else 109 { 110 this.info = new String [info.length]; 111 for (int i = 0; i < info.length; i++) 112 { 113 this.info[i] = String.valueOf(info[i]); 114 } 115 } 116 this.code = code; 117 this.throwable = throwable; 118 } 119 120 125 public FileSystemException(final Throwable throwable) 126 { 127 this(throwable.getMessage(), null, throwable); 128 } 129 130 135 public final Throwable getCause() 136 { 137 return throwable; 138 } 139 140 146 public String getCode() 147 { 148 return code; 149 } 150 151 157 public String [] getInfo() 158 { 159 return info; 160 } 161 } 162 | Popular Tags |