• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documenthandler.php
  • Класс: BitrixDiskDocumentDocumentHandler
  • Вызов: DocumentHandler::downloadFile
public function downloadFile(FileData $fileData);

/**
 * Download part of file from cloud service by FileData::id, put contents in FileData::src
 * @param FileData $fileData
 * @param          $startRange
 * @param          $chunkSize
 * @return FileData|null
 */
abstract public function downloadPartFile(FileData $fileData, $startRange, $chunkSize);

/**
 * Delete file from cloud service by FileData::id
 * @param FileData $fileData
 * @return bool
 */
abstract public function deleteFile(FileData $fileData);

/**
 * Get data for showing preview file.
 * Array must be contains keys: id, viewUrl, neededDelete, neededCheckView
 * @param FileData $fileData
 * @return array|null
 */
abstract public function getDataForViewFile(FileData $fileData);

/**
 * Tells if file in cloud service was changed. For example, the method compares created date and modified date.
 *
 * @param array $currentMetadata Metadata (@see BitrixDiskDocument::getFileMetadata());
 * @param array $oldMetadata Old metadata.
 * @return bool
 */
public function wasChangedAfterCreation(array $currentMetadata, array $oldMetadata = array())
{
	if(isset($currentMetadata['etag'], $oldMetadata['etag']))
	{
		return $currentMetadata['etag'] !== $oldMetadata['etag'];
	}

	$this->errorCollection[] = new Error('Could not get etag', self::ERROR_CODE_NOT_FOUND_ETAG);

	return false;
}