public static boolean isImage ( File file ) { return file != null ? IMAGE_FILE_EXTENSIONS . contains ( Files . getExtension ( file ) ) : false ; }
Guess if file is an image file based on file extension . This is a very trivial test relying on file extension and obviously cannot guarantee correct results .