public function get(string $path) : string
{
// Asking random server
$path = $this->getFilePath($path);
$response = $this->sendRequest($path, self::METHOD_GET);
if (self::STATUS_200_OK !== $response->getStatusCode()) {
throw new FileNotExistException(sprintf('File %s does not exist.', $path));
}
return (string) $response->getBody();
}
/** * Tests file contents retrieving if there was a directory name given. * * @depends testMkdir */ public function testGetIfDir() { $this->setExpectedException('\\Jyxo\\Webdav\\FileNotExistException'); $this->client->get($this->dir); }