1<?php
2
3namespace League\Flysystem;
4
5use Exception as BaseException;
6
7class FileExistsException extends Exception
8{
9    /**
10     * @var string
11     */
12    protected $path;
13
14    /**
15     * Constructor.
16     *
17     * @param string     $path
18     * @param int        $code
19     * @param \Exception $previous
20     */
21    public function __construct($path, $code = 0, BaseException $previous = null)
22    {
23        $this->path = $path;
24
25        parent::__construct('File already exists at path: '.$this->getPath(), $code, $previous);
26    }
27
28    /**
29     * Get the path which was not found.
30     *
31     * @return string
32     */
33    public function getPath()
34    {
35        return $this->path;
36    }
37}
38