Class FileSystemException

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

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

    • serialVersionUID

      private static final long serialVersionUID
      serialVersionUID format is YYYYMMDD for the date of the last binary change.
      See Also:
    • URL_PATTERN

      private static final Pattern URL_PATTERN
      URL pattern
    • PASSWORD_PATTERN

      private static final Pattern PASSWORD_PATTERN
      Password pattern
    • info

      private final String[] info
      Array of complementary info (context).
  • Constructor Details

    • FileSystemException

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

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

      public FileSystemException(String code, Object info0, Throwable throwable)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      info0 - one context information.
      throwable - the cause.
    • 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, Throwable throwable)
      Constructs exception with the specified detail message.
      Parameters:
      code - the error code of the message.
      throwable - the original cause
    • FileSystemException

      @Deprecated public FileSystemException(String code, Object[] info, Throwable throwable)
      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).
      throwable - the cause.
    • FileSystemException

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

      public FileSystemException(Throwable throwable)
      Constructs wrapper exception.
      Parameters:
      throwable - 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
    • getMessage

      public String getMessage()
      Retrieves message from bundle.
      Overrides:
      getMessage in class Throwable
      Returns:
      The exception message.
    • 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.