since 3.1 - replacement legacy file API methods can be found on the moodle_url class, for example: The moodle_url::make_legacyfile_url() method can be used to generate a legacy course file url. To generate course module file.php url the moodle_url::make_file_url() should be used.
since Moodle 2.2 - use moodle exception instead This exception must be thrown to the web service client when a web service parameter is invalid The error string is gotten from webservice.php