Class FileValidator

java.lang.Object
io.github.multiform_validator.FileValidator

public class FileValidator extends Object
  • Method Details

    • isValidImage

      public static boolean isValidImage(File file)
      Validates an image file.
      Parameters:
      file - The image file to validate.
      Returns:
      true if the file is a valid image, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.
    • isValidImage

      public static boolean isValidImage(File file, List<String> exclude)
      Validates an image file, excluding specific file types.
      Parameters:
      file - The image file to validate.
      exclude - A list of file types to exclude from validation.
      Returns:
      true if the file is a valid image, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.
    • isValidAudio

      public static boolean isValidAudio(File file)
      Validates an audio file.
      Parameters:
      file - The audio file to validate.
      Returns:
      true if the file is a valid audio, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.
    • isValidAudio

      public static boolean isValidAudio(File file, List<String> exclude)
      Validates an audio file, excluding specific file types.
      Parameters:
      file - The audio file to validate.
      exclude - A list of file types to exclude from validation.
      Returns:
      true if the file is a valid audio, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.
    • isValidPdf

      public static boolean isValidPdf(File file)
      Validates a PDF file.
      Parameters:
      file - The PDF file to validate.
      Returns:
      true if the file is a valid PDF, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.
    • isValidTxt

      public static boolean isValidTxt(File file)
      Validates a TXT file.
      Parameters:
      file - The TXT file to validate.
      Returns:
      true if the file is a valid TXT, false otherwise.
      Throws:
      IllegalArgumentException - if the input value is null.