protected function copy_data(array $path, array $destination) {
        global $CFG;
        $filename = array_pop($destination);
        $destdirectory = implode(DIRECTORY_SEPARATOR, $destination);
        $fulldestination = $this->path . DIRECTORY_SEPARATOR . $destdirectory;
        check_dir_exists($fulldestination, true, true);
        $fulldestination .= $filename;
        $currentpath = $CFG->dirroot . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $path);
        copy($currentpath, $fulldestination);
        $this->files[$destdirectory . DIRECTORY_SEPARATOR . $filename] = $fulldestination;
    }