/**
* Get all the meta data of a file or directory.
*
* @param string $path
* @return array|false
* @throws \OSS\Core\OssException
*/
public function getMetadata($path)
{
$object = $this->applyPathPrefix($path);
try {
$result = $this->client->getObjectMeta($this->bucket, $object);
} catch (OssException $e) {
return false;
}
return ['type' => 'file', 'dirname' => Util::dirname($path), 'path' => $path, 'timestamp' => strtotime($result['last-modified']), 'mimetype' => $result['content-type'], 'size' => $result['content-length']];
}