getParam('file'); if (empty($from)) { return $response->withStatus(500) ->withJson(new Entity\Api\Error(500, __('File not specified.'))); } $to = $request->getParam('newPath'); if (empty($to)) { return $response->withStatus(500) ->withJson(new Entity\Api\Error(500, __('New path not specified.'))); } // No-op if paths match if ($from === $to) { return $response->withJson(new Entity\Api\Status()); } $station = $request->getStation(); $storageLocation = $station->getMediaStorageLocation(); $fsMedia = (new StationFilesystems($station))->getMediaFilesystem(); $fsMedia->move($from, $to); $batchUtilities->handleRename($from, $to, $storageLocation, $fsMedia); return $response->withJson(new Entity\Api\Status()); } }