/** * Create and init object. Set absolute path. * * @param string $absolutePath file absolute path * @return void */ public function __construct($absolutePath, $isSymLink = false) { $this->absolutePath = JPath::clean($absolutePath); $this->relativePath = JoomDOCFileSystem::getRelativePath($this->absolutePath); $this->isSymLink = $isSymLink; $this->name = parent::getName($this->absolutePath); $this->extension = parent::getExt($this->absolutePath); $this->size = JoomDOCFileSystem::getFileSize($this->absolutePath); $this->url = JoomDOCFileSystem::getURL($this->relativePath); $this->document = null; $this->hits = 0; $this->uploaded = filemtime($this->absolutePath); $this->mimetype = function_exists('mime_content_type') && is_readable($this->absolutePath) ? mime_content_type($this->absolutePath) : ''; }