Class FileSystemException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FileNotFolderException, FileNotFoundException, FileTypeHasNoContentException

public class FileSystemException extends IOException
Thrown for file system errors.
See Also:
  • Constructor Details

    • FileSystemException

      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
    • FileSystemException

      public FileSystemException(String code, Object info)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      info - one context information.
    • FileSystemException

      public FileSystemException(String code, Object... info)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      info - array of complementary info (context).
    • FileSystemException

      public FileSystemException(String code, Object info, Throwable cause)
      Constructs exception with the specified detail message and cause.
      Parameters:
      code - the error code of the message.
      info - one context information.
      cause - the cause.
    • FileSystemException

      @Deprecated public FileSystemException(String code, Object[] info, Throwable cause)
      Deprecated.
      Use instead FileSystemException(String, Throwable, Object[]). Will be removed in 3.0.
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      info - array of complementary info (context).
      cause - the cause.
    • FileSystemException

      public FileSystemException(String code, Throwable cause)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      cause - the original cause
    • FileSystemException

      public FileSystemException(String code, Throwable cause, Object... info)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      info - array of complementary info (context).
      cause - the cause.
    • FileSystemException

      Constructs wrapper exception.
      Parameters:
      cause - the root cause to wrap.
  • Method Details

    • requireNonNull

      public static <T> T requireNonNull(T obj, String code) throws FileSystemException
      Throws a FileSystemException when the given object is null.
      Type Parameters:
      T - the type of the reference
      Parameters:
      obj - the object reference to check for null.
      code - message used when FileSystemException is thrown
      Returns:
      obj if not null
      Throws:
      FileSystemException - if obj is null
      Since:
      2.3
    • requireNonNull

      public static <T> T requireNonNull(T obj, String code, Object... info) throws FileSystemException
      Throws a FileSystemException when the given object is null.
      Type Parameters:
      T - the type of the reference
      Parameters:
      obj - the object reference to check for null.
      code - message used when FileSystemException is thrown
      info - one context information.
      Returns:
      obj if not null
      Throws:
      FileSystemException - if obj is null
      Since:
      2.3
    • getCode

      public String getCode()
      Retrieves error code of the exception. Could be used as key for internationalization.
      Returns:
      the code.
    • getInfo

      public String[] getInfo()
      Retrieves array of complementary info (context). Could be used as parameter for internationalization.
      Returns:
      the context info.
    • getMessage

      public String getMessage()
      Retrieves message from bundle.
      Overrides:
      getMessage in class Throwable
      Returns:
      The exception message.