public function doesObjectExist($bucket, $object, $options = NULL)
{
$this->precheckCommon($bucket, $object, $options);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
$options[self::OSS_OBJECT] = $object;
$response = $this->auth($options);
$result = new ExistResult($response);
return $result->getData();
}
/** * Check whether a file exists. * * @param string $path * @return bool */ public function has($path) { $object = $this->applyPathPrefix($path); try { $exists = $this->client->doesObjectExist($this->bucket, $object); } catch (OssException $e) { return false; } return $exists; }