filePathResolver->getUniqueFileName($uploadDir, $file); $this->filePathResolver->createDirectory($uploadDir); try { $file->move($uploadDir, $fileName); return $fileName; } catch (FileException) { throw new FileUploadException('Could not upload file'); } } catch (FilePathException $e) { throw new FileUploadException($e->getMessage()); } } /** * @param string $path */ public function delete($path): void { $this->filePathResolver->delete($path); } }