private function addChildren($path, $file, $tree = [])
    {
        $child = null;

        if (count($path) > 0) {
            $child = array_shift($path);
            $tree = $this->addChildren($path, $file, $tree);
        }

        $newTree = [];
        if ($child) {
            $newTree['folders'][$child] = $tree;
        } else {
            $newTree['files'][] = $file;
        }

        return $newTree;
    }