1 17 18 package org.apache.avalon.util.env ; 19 20 import java.io.IOException ; 21 22 29 public class EnvAccessException extends IOException 30 { 31 32 public final String m_variable ; 33 34 public final Throwable m_cause ; 35 36 43 EnvAccessException( final Throwable a_cause ) 44 { 45 super() ; 46 47 m_variable = null ; 48 m_cause = a_cause ; 49 } 50 51 52 59 EnvAccessException( final String a_message ) 60 { 61 super( a_message ) ; 62 63 m_variable = null ; 64 m_cause = null ; 65 } 66 67 68 76 EnvAccessException( final String a_variable, final Throwable a_cause ) 77 { 78 super() ; 79 80 m_variable = a_variable ; 81 m_cause = a_cause ; 82 } 83 84 85 93 EnvAccessException( final String a_variable, final String a_message ) 94 { 95 super( a_message ) ; 96 97 m_variable = a_variable ; 98 m_cause = null; 99 } 100 101 102 107 public String getVariable() 108 { 109 return m_variable ; 110 } 111 112 113 118 public Throwable getCause() 119 { 120 return m_cause ; 121 } 122 123 124 129 public String getMessage() 130 { 131 String l_base = super.getMessage() ; 132 133 if ( null == l_base ) 134 { 135 return "Failed to access " + m_variable + " environment variable" ; 136 } 137 138 return "Failed to access " + m_variable 139 + " environment variable - " + l_base ; 140 } 141 } 142 143 144 145 | Popular Tags |