private function mirrorFile($path, FilesystemInterface $remote, AdapterInterface $remoteAdapter)
{
$masterContent = $this->master->read($path);
if (!is_string($masterContent)) {
throw new \RuntimeException(sprintf('File %s could not be read on master storage', $path));
}
$isOnRemote = $remote->has($path);
if ($isOnRemote && !$remote->update($path, $masterContent)) {
throw $this->createRuntimeException('File', $path, 'updated', $remoteAdapter);
} elseif (!$isOnRemote && !$remote->write($path, $masterContent)) {
throw $this->createRuntimeException('File', $path, 'created', $remoteAdapter);
}
}