You are here

protected function FeedsFetcherResult::checkFile in Feeds 7.2

Checks that a file exists and is readable.

Throws

RuntimeException Thrown if the file isn't readable or writable.

2 calls to FeedsFetcherResult::checkFile()
FeedsFetcherResult::getFilePath in plugins/FeedsFetcher.inc
Get a path to a temporary file containing the resource provided by the fetcher.
FeedsFileFetcherResult::getFilePath in plugins/FeedsFileFetcher.inc
Overrides parent::getFilePath().

File

plugins/FeedsFetcher.inc, line 163
Contains the FeedsFetcher and related classes.

Class

FeedsFetcherResult
Base class for all fetcher results.

Code

protected function checkFile() {
  if (!file_exists($this->file_path)) {
    throw new RuntimeException(t('File %filepath does not exist.', array(
      '%filepath' => $this->file_path,
    )));
  }
  if (!is_readable($this->file_path)) {
    throw new RuntimeException(t('File %filepath is not readable.', array(
      '%filepath' => $this->file_path,
    )));
  }
}