/**
* {@inheritDoc}
*/
public function getFile($path)
{
$file = new \Jarves\File\FileInfo();
$file->setPath($path ?: '/');
$path = $this->getFullPath($path ?: '/');
if (!file_exists($path)) {
throw new FileNotFoundException(sprintf('File `%s` does not exists.', $path));
}
if (!is_readable($path)) {
throw new FileNotFoundException(sprintf('File `%s` is not readable.', $path));
}
$file->setType(is_dir($path) ? 'dir' : 'file');
$file->setCreatedTime(filectime($path));
$file->setModifiedTime(filectime($path));
$file->setSize(filesize($path));
return $file;
}