Module jcifs

Class SmbException

All Implemented Interfaces:
Serializable, DosError, NtStatus, WinError
Direct Known Subclasses:
DfsReferral, SmbAuthException, SmbEndOfFileException, SMBSignatureValidationException, SmbUnsupportedOperationException

public class SmbException extends CIFSException implements NtStatus, DosError, WinError
There are hundreds of error codes that may be returned by a CIFS server. Rather than represent each with it's own Exception class, this class represents all of them. For many of the popular error codes, constants and text messages like "The device is not ready" are provided.

The jCIFS client maps DOS error codes to NTSTATUS codes. This means that the user may receive a different error from a legacy server than that of a newer variant such as Windows NT and above. If you should encounter such a case, please report it to jcifs at samba dot org and we will change the mapping.

See Also:
  • Constructor Details

    • SmbException

      public SmbException()
      /** Constructs an SmbException with no detail message
    • SmbException

      public SmbException(int errcode, Throwable rootCause)
      Constructs an SmbException with the specified error code and root cause
      Parameters:
      errcode - the SMB error code
      rootCause - the underlying cause of this exception
    • SmbException

      public SmbException(String msg)
      Constructs an SmbException with the specified detail message
      Parameters:
      msg - the detail message
    • SmbException

      public SmbException(String msg, Throwable rootCause)
      Constructs an SmbException with the specified detail message and root cause
      Parameters:
      msg - the detail message
      rootCause - the underlying cause of this exception
    • SmbException

      public SmbException(int errcode, boolean winerr)
      Constructs an SmbException with the specified error code
      Parameters:
      errcode - the error code (either SMB or Windows error code)
      winerr - true if errcode is a Windows error code, false if it's an SMB error code
  • Method Details

    • getMessageByCode

      public static String getMessageByCode(int errcode)
      Get the message string for an NT STATUS code
      Parameters:
      errcode - the NT STATUS error code
      Returns:
      message for NT STATUS code
    • getNtStatus

      public int getNtStatus()
      Get the NT STATUS code associated with this exception
      Returns:
      status code
    • getRootCause

      @Deprecated public Throwable getRootCause()
      Deprecated.
      Get the root cause of this exception (deprecated - use getCause() instead)
      Returns:
      cause