JAFS API v2

org.openafs.jafs
Class AFSFileException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.io.IOException
                    |
                    +--org.openafs.jafs.AFSFileException
All Implemented Interfaces:
Serializable

public class AFSFileException
extends IOException

An exception indicating that a file related error has occured in the Java AFS API, in the Java AFS JNI, or in the AFS file system.

This exception extends Java's java.io.IOException and is therefore often used as a substitution for IOException.

Version:
2.0, 04/16/2001, 1.0, 05/25/2000
See Also:
AFSException, IOException, Serialized Form

Field Summary
protected  int errno
          The AFS specific error number (code).
 
Fields inherited from class java.lang.Exception
 
Constructor Summary
AFSFileException(int errno)
          Constructs an AFSFileException with the specified error code.
AFSFileException(String reason)
          Constructs an AFSFileException with the specified detail message.
AFSFileException(String reason, int errno)
          Constructs an AFSFileException with the specified detail message and specified error code.
 
Method Summary
 String getAFSMessage()
          Returns the AFS error message string defined by the ErrorTable class.
 String getAFSMessage(Locale locale)
          Returns the AFS error message defined by the ErrorTable class.
 int getErrorCode()
          Returns the AFS specific error number (code).
 String getMessage()
          Returns the error message string of this exception.
 String getMessage(Locale locale)
          Returns the locale specific error message string of this exception.
 String toString()
          Returns a string representation of this AFS Exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

errno

protected int errno
The AFS specific error number (code).

See Also:
getErrorCode()
Constructor Detail

AFSFileException

public AFSFileException(String reason)
Constructs an AFSFileException with the specified detail message.

Parameters:
reason - the detail message.

AFSFileException

public AFSFileException(int errno)
Constructs an AFSFileException with the specified error code. This constructor will also generate the appropriate error message respective to the specified error code.

Parameters:
errno - the AFS error number (error code).

AFSFileException

public AFSFileException(String reason,
                        int errno)
Constructs an AFSFileException with the specified detail message and specified error code. In this constructor the specified detail message overrides the default AFS error message defined by the ErrorTable class. Therefore, to retrieve the AFS specific error message, you must use the getAFSMessage() method. The getMessage() method will return the message specified in this constructor.

Parameters:
reason - the detail message.
errno - the AFS error number (error code).
See Also:
getAFSMessage()
Method Detail

getErrorCode

public int getErrorCode()
Returns the AFS specific error number (code). This code can be interpreted by use of the ErrorTable class method ErrorTable.getMessage(int).

Returns:
the AFS error code of this AFSException object.
See Also:
ErrorTable.getMessage(int)

getMessage

public String getMessage()
Returns the error message string of this exception.

Overrides:
getMessage in class Throwable
Returns:
the error message string of this exception object.
See Also:
getAFSMessage()

getMessage

public String getMessage(Locale locale)
Returns the locale specific error message string of this exception.

Parameters:
locale - the locale for which this message will be displayed
Returns:
the error message string of this exception object.
See Also:
getAFSMessage()

getAFSMessage

public String getAFSMessage()
Returns the AFS error message string defined by the ErrorTable class. The message will be formatted according to the default Locale.

This message is also available from this object's super class method getMessage. However, this method will always return the string message associated with the actual AFS error code/number specified, whereas the getMessage() method will return the string message intended for this Exception object, which may be an overridden message defined in the constructor of this Exception.

Returns:
the AFS error message string of this exception object.
See Also:
getAFSMessage(Locale), AFSFileException(String, int), ErrorTable.getMessage(int), Throwable.getMessage()

getAFSMessage

public String getAFSMessage(Locale locale)
Returns the AFS error message defined by the ErrorTable class. The message will be formatted according to the specified Locale.

This message is also available from this object's super class method getMessage. However, this method will always return the string message associated with the actual AFS error code/number specified, whereas the getMessage() method will return the string message intended for this Exception object, which may be an overridden message defined in the constructor of this Exception.

Parameters:
locale - the locale for which this message will be displayed
Returns:
the AFS error message string of this exception object.
See Also:
getAFSMessage(), AFSFileException(String, int), ErrorTable.getMessage(int, Locale), Throwable.getMessage()

toString

public String toString()
Returns a string representation of this AFS Exception.

Overrides:
toString in class Throwable
Returns:
the AFS error message string of this AFSFileException object.
See Also:
getMessage()

JAFS API v2