| 1 | <?php |
||
| 26 | class FileResource extends AbstractFilesystemResource implements BodyResource |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | 397 | public function __construct($filesystemPath, $path = null) |
|
| 32 | { |
||
| 33 | 397 | Assert::file($filesystemPath); |
|
| 34 | |||
| 35 | 395 | parent::__construct($filesystemPath, $path); |
|
| 36 | 395 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | 56 | public function getBody() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 3 | public function getChild($relPath) |
|
| 50 | { |
||
| 51 | 3 | throw ResourceNotFoundException::forPath($this->getPath().'/'.$relPath); |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | 3 | public function hasChild($relPath) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | */ |
||
| 65 | 27 | public function hasChildren() |
|
| 69 | |||
| 70 | /** |
||
| 71 | * {@inheritdoc} |
||
| 72 | */ |
||
| 73 | 107 | public function listChildren() |
|
| 77 | } |
||
| 78 |