protected function validateFile($filePath, $message = 'File', $allowEmpty = true)
    {
        if (! file_exists($filePath) || ! is_readable($filePath)) {
            throw new \RuntimeException("$message '{$filePath}' doesn't exist or is not readable.");
        }

        if (! $allowEmpty && 0 === filesize($filePath)) {
            throw new \RuntimeException("$message '{$filePath}' is empty.");
        }

        return realpath($filePath);
    }