public function pasteAction(ParamFetcher $paramFetcher)
{
$files = $paramFetcher->get('files');
$target = $paramFetcher->get('target');
$overwrite = filter_var($paramFetcher->get('overwrite'), FILTER_VALIDATE_BOOLEAN);
$move = filter_var($paramFetcher->get('move'), FILTER_VALIDATE_BOOLEAN);
$this->checkAccess($target);
foreach ($files as $file) {
$this->checkAccess($file);
$newPath = $target . '/' . basename($file);
if (!$overwrite && $this->webFilesystem->has($newPath)) {
return ['targetExists' => true];
}
$this->newFeed($file, $move ? 'moved' : 'copied', sprintf('from %s to %s', $file, $newPath));
}
return $this->webFilesystem->paste($files, $target, $move ? 'move' : 'copy');
}