3 namespace Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher;
5 use Drupal\migrate\MigrateException;
6 use Drupal\migrate_plus\DataFetcherPluginBase;
9 * Retrieve data from a local path or general URL for migration.
13 * title = @Translation("File")
16 class File extends DataFetcherPluginBase {
21 public function setRequestHeaders(array $headers) {
28 public function getRequestHeaders() {
36 public function getResponse($url) {
37 $response = file_get_contents($url);
38 if ($response === FALSE) {
39 throw new MigrateException('file parser plugin: could not retrieve data from ' . $url);
47 public function getResponseContent($url) {
48 $response = $this->getResponse($url);