Class IllegalFileException

All Implemented Interfaces:
Serializable

public class IllegalFileException extends IllegalArgumentException
Exception thrown when a file fails validation (e.g. disallowed name or content type).

Extends IllegalArgumentException for backward compatibility with existing catch blocks.

Use getLocalizedMessage() to retrieve the message translated to the current user locale when sending feedback to the frontend.

See Also:
  • Constructor Details

    • IllegalFileException

      public IllegalFileException(String message)
    • IllegalFileException

      public IllegalFileException(String message, String param)
      Creates an exception with a message key and a parameter to format into the message.
      Parameters:
      message - the message key
      param - the value to format into the message (e.g. file name or file type)
  • Method Details

    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getLocalizedMessage

      public String getLocalizedMessage()
      Returns the exception message translated to the current user locale, with any format parameters applied.
      Overrides:
      getLocalizedMessage in class Throwable
      Returns:
      the translated and formatted message