| @@ 22-32 (lines=11) @@ | ||
| 19 | * |
|
| 20 | * @return JsonResponse |
|
| 21 | */ |
|
| 22 | public function listAction($name) |
|
| 23 | { |
|
| 24 | try { |
|
| 25 | return $this->listFiles($name); |
|
| 26 | } catch (\Exception $e) { |
|
| 27 | return new JsonResponse([ |
|
| 28 | 'status' => 'error', |
|
| 29 | 'message' => $e->getMessage(), |
|
| 30 | ]); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| 34 | private function listFiles($name) |
|
| 35 | { |
|
| @@ 23-33 (lines=11) @@ | ||
| 20 | * |
|
| 21 | * @return JsonResponse |
|
| 22 | */ |
|
| 23 | public function uploadAction($name = null) |
|
| 24 | { |
|
| 25 | try { |
|
| 26 | return $this->upload($name); |
|
| 27 | } catch (\Exception $e) { |
|
| 28 | return new JsonResponse([ |
|
| 29 | 'status' => 'error', |
|
| 30 | 'message' => $e->getMessage(), |
|
| 31 | ]); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | private function upload($name) |
|
| 36 | { |
|