- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/diskstorage.php
- Класс: CDiskStorage
- Вызов: CDiskStorage::formatFileToResponse
private function formatFileToResponse(File $file)
{
if(empty($file) || !$file->getName())
{
return array();
}
$path = $this->getBreadcrumbs($file);
if(!$path)
{
return array();
}
$result = array(
'id' => $this->generateId(array('FILE' => true, 'ID' => $file->getId())),
'isDirectory' => false,
'isDeleted' => false,
'storageId' => $this->getStringStorageId(),
'path' => '/' . trim($path, '/'),
'name' => (string)$file->getName(),
'revision' => $file->getFileId(),
'version' => (string)$this->generateTimestamp($file->getUpdateTime()->getTimestamp()),
'extra' => array(
'id' => (string)$file->getId(),
'iblockId' => (string)$file->getStorageId(),
'sectionId' => (string)$file->getParentId(),
'rootSectionId' => (string)$this->storage->getRootObjectId(),
'name' => (string)$file->getName(),
),
'size' => (string)$file->getSize(),
'permission' => 'W',
'createdBy' => (string)$file->getCreatedBy(),
'modifiedBy' => (string)$file->getUpdatedBy(),
);
if($this->storage->getRootObjectId() != $file->getParentId())
{
$result['parentId'] = $this->generateId(array('FILE' => false, 'ID' => $file->getParentId()));
}
return $result;
}