Package io.github.multiform_validator
Class FileValidator
java.lang.Object
io.github.multiform_validator.FileValidator
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidAudio(File file) Validates an audio file.static booleanisValidAudio(File file, List<String> exclude) Validates an audio file, excluding specific file types.static booleanisValidImage(File file) Validates an image file.static booleanisValidImage(File file, List<String> exclude) Validates an image file, excluding specific file types.static booleanisValidPdf(File file) Validates a PDF file.static booleanisValidTxt(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.
-