private string ExtractPath(string absolutePath, bool addPath = true)
{
const char TestChar = '/';
var lastIndexOfSlash = absolutePath.LastIndexOf(TestChar);
var path = absolutePath.Substring(0, lastIndexOfSlash).TrimEnd(TestChar);
if (addPath)
{
path = ftpRoot.TrimEnd(TestChar) + TestChar + path.TrimStart(TestChar);
}
return path;
}