public static function get_moodle_file($reference) {
        $params = file_storage::unpack_reference($reference, true);
        $fs = get_file_storage();
        return $fs->get_file($params['contextid'], $params['component'], $params['filearea'],
                    $params['itemid'], $params['filepath'], $params['filename']);
    }