Package io.github.multiform_validator
Class FileValidator
java.lang.Object
io.github.multiform_validator.FileValidator
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValidAudio
(File file) Validates an audio file.static boolean
isValidAudio
(File file, List<String> exclude) Validates an audio file, excluding specific file types.static boolean
isValidImage
(File file) Validates an image file.static boolean
isValidImage
(File file, List<String> exclude) Validates an image file, excluding specific file types.static boolean
isValidPdf
(File file) Validates a PDF file.static boolean
isValidTxt
(File file) Validates a TXT file.
-
Method Details
-
isValidImage
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
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
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
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
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
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.
-