private function moveFile($path, $root)
{
$hash = sha1($this->adapter->fetchItem($path));
$name = sprintf('%s/%s/%s.%s', substr($hash, 0, 1), substr($hash, 1, 2), $hash, pathinfo($path, PATHINFO_EXTENSION));
$dest = trim($root, '/') . '/' . $name;
if (is_string($this->adapter->getClient())) {
$dir = $this->adapter->getClient() . '/' . dirname($dest);
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
}
}
$this->adapter->moveItem($path, $dest);
return $name;
}