protected function cleanPath($path)
{
$path = $this->adapter->realpath((string) $path);
if ($path === false) {
$path = '';
} else {
if (DIRECTORY_SEPARATOR != '/' || $path != '/') {
$path = rtrim($path, DIRECTORY_SEPARATOR);
}
}
return $path;
}