files: add method to check if a file is valid

Signed-off-by: Sébastien Boisvert <sebastien.boisvert.3@ulaval.ca>