LCM Software
TFTP Package v1.5

com.lcmsoft.tftp
Class TftpErrorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by com.lcmsoft.tftp.TftpErrorException
All Implemented Interfaces:
java.io.Serializable

public class TftpErrorException
extends java.io.IOException

Thrown to indicate that a TFTP error has occurred. A TftpErrorException is thrown as a result of a remote error, that is, an error signaled by the remote host. Since all TFTP errors cause the termination of the request, once a TftpErrorException has been thrown the request must be abandoned and no further communication must be tried.

A TftpErrorException has a numeric error code, indicating the nature of the error, and a descriptive text message. The class defines convenient constants for all standard error codes specified by the TFTP standard. The text message may be empty, but is guaranteed to be non-null.

See Also:
Serialized Form

Field Summary
static int ERROR_ACCESS_VIOLATION
          Access violation.
static int ERROR_DISK_FULL
          Disk full or allocation exceeded.
static int ERROR_FILE_EXISTS
          File already exists.
static int ERROR_FILE_NOT_FOUND
          File not found.
static int ERROR_ILLEGAL_OPERATION
          Illegal TFTP operation.
static int ERROR_NO_SUCH_USER
          No such user.
static int ERROR_NOT_DEFINED
          Not defined.
static int ERROR_OPTION_NEGOTIATION
          Transfer terminated due to option negotiation.
static int ERROR_UNKNOW_ID
          Unknow transfer ID.
 
Method Summary
 int getCode()
          Returns the error code.
 java.lang.String getMessage()
          Returns the error message.
 java.lang.String toString()
          Returns a string representation of this 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

ERROR_NOT_DEFINED

public static final int ERROR_NOT_DEFINED
Not defined.

See Also:
Constant Field Values

ERROR_FILE_NOT_FOUND

public static final int ERROR_FILE_NOT_FOUND
File not found.

See Also:
Constant Field Values

ERROR_ACCESS_VIOLATION

public static final int ERROR_ACCESS_VIOLATION
Access violation.

See Also:
Constant Field Values

ERROR_DISK_FULL

public static final int ERROR_DISK_FULL
Disk full or allocation exceeded.

See Also:
Constant Field Values

ERROR_ILLEGAL_OPERATION

public static final int ERROR_ILLEGAL_OPERATION
Illegal TFTP operation.

See Also:
Constant Field Values

ERROR_UNKNOW_ID

public static final int ERROR_UNKNOW_ID
Unknow transfer ID.

See Also:
Constant Field Values

ERROR_FILE_EXISTS

public static final int ERROR_FILE_EXISTS
File already exists.

See Also:
Constant Field Values

ERROR_NO_SUCH_USER

public static final int ERROR_NO_SUCH_USER
No such user.

See Also:
Constant Field Values

ERROR_OPTION_NEGOTIATION

public static final int ERROR_OPTION_NEGOTIATION
Transfer terminated due to option negotiation.

See Also:
Constant Field Values
Method Detail

getCode

public int getCode()
Returns the error code. The error code depicts the nature of the error that caused this exception. It is up to the remote host to provide an appropriated error code.

Returns:
the error code, as provided by the remote host

getMessage

public java.lang.String getMessage()
Returns the error message. The error message is intended to provide a human readable description of the error. It is up to the remote host to provide or not an error message.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the error message, as provided by the remote host

toString

public java.lang.String toString()
Returns a string representation of this exception. The string representation contains the actual class name, the error message and the error code, as follows:

class name: error message (error code)

Overrides:
toString in class java.lang.Throwable
Returns:
a string containing all information about this exception

Copyright © 2004 LCM Software
All rights reserved